Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Print Routine Error

Hi Group;

I copied this from one of the other users in the users group, However I get
an error near the bottom of the code!

We are currently using Excel 2002

With ws.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&" "Arial,Bold" "Errors in Student File Report"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed '! Error on this Line
End With
' ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.SelectedSheets.PrintPreview

Does anyone know why I am getting the error on the above line?
Also are all these lines necessary?

Thank You Group
Nancy X.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Print Routine Error

Could be that you have a version before xl2002. Remove line along with any
others NOT necessary to what you are doing as pagesetup really slows down
macros. Best to use a template worksheet instead.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Nancy X" wrote in message
...
Hi Group;

I copied this from one of the other users in the users group, However I
get
an error near the bottom of the code!

We are currently using Excel 2002

With ws.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&" "Arial,Bold" "Errors in Student File Report"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed '! Error on this Line
End With
' ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.SelectedSheets.PrintPreview

Does anyone know why I am getting the error on the above line?
Also are all these lines necessary?

Thank You Group
Nancy X.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Print Routine Error

Don;
Thanks for getting back to me!

It is a retail copy of Excel 2002. The regional education center had
a serious problem with Vista so we reverted back for a while!

This is the first time in my life I have ever use Excel, so to say I
am green is an understatement.

Is there someplace you can direct me to see a template worksheet?

Thanks Again

Nancy X.

"Don Guillett" wrote:

Could be that you have a version before xl2002. Remove line along with any
others NOT necessary to what you are doing as pagesetup really slows down
macros. Best to use a template worksheet instead.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Nancy X" wrote in message
...
Hi Group;

I copied this from one of the other users in the users group, However I
get
an error near the bottom of the code!

We are currently using Excel 2002

With ws.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&" "Arial,Bold" "Errors in Student File Report"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed '! Error on this Line
End With
' ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.SelectedSheets.PrintPreview

Does anyone know why I am getting the error on the above line?
Also are all these lines necessary?

Thank You Group
Nancy X.





  #4   Report Post  
Posted to microsoft.public.excel.programming
len len is offline
external usenet poster
 
Posts: 53
Default Print Routine Error

Nancy;
I am not a real good Excel Macro programmer, but I am in Education
20 hours a week and the military base attached to our school district the
remaining time.

You are going to have to filter the data twice!

The first time just the ActiveSheet.

If you need to display the blank Column(I do not know why you would?) make
sure your columns fit.

There are two methods: The one I like is shown below because for some
reason Autofit does not always execute!

With ws.Range("A:?").EntireColumn
.ColumnWidth = 85
.AutoFit
End With

? is your last column + 1.

The reason for the 85 is that it will put 85 spaces in your column and print
that way.

The print part is very easy!

ActiveSheet.PrintPreview

When the print layout shows you can print it or close it.

Now you have to perform your filter again (There is an instruction on how to
reset it, but I cannot remember the exact script)

Apply your new filter, move your data from your activesheet to your new
sheet and then save it as you requested in Saturday's request.

If you are going to display your data again, repeat the Autofit code again.

Hope I am not messing you up!

Good Luck and happy class scheduling? I am guessing that is what you are
trying to do!

Len



"Nancy X" wrote:

Don;
Thanks for getting back to me!

It is a retail copy of Excel 2002. The regional education center had
a serious problem with Vista so we reverted back for a while!

This is the first time in my life I have ever use Excel, so to say I
am green is an understatement.

Is there someplace you can direct me to see a template worksheet?

Thanks Again

Nancy X.

"Don Guillett" wrote:

Could be that you have a version before xl2002. Remove line along with any
others NOT necessary to what you are doing as pagesetup really slows down
macros. Best to use a template worksheet instead.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Nancy X" wrote in message
...
Hi Group;

I copied this from one of the other users in the users group, However I
get
an error near the bottom of the code!

We are currently using Excel 2002

With ws.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&" "Arial,Bold" "Errors in Student File Report"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed '! Error on this Line
End With
' ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.SelectedSheets.PrintPreview

Does anyone know why I am getting the error on the above line?
Also are all these lines necessary?

Thank You Group
Nancy X.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Print Routine Error

You version of Excel probably doesn't support that command. Just remove that
line.

--
Regards,
Tom Ogilvy


"Nancy X" wrote:

Hi Group;

I copied this from one of the other users in the users group, However I get
an error near the bottom of the code!

We are currently using Excel 2002

With ws.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
.CenterHeader = "&" "Arial,Bold" "Errors in Student File Report"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed '! Error on this Line
End With
' ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.SelectedSheets.PrintPreview

Does anyone know why I am getting the error on the above line?
Also are all these lines necessary?

Thank You Group
Nancy X.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB routine to print to PDF? fedude Excel Worksheet Functions 4 March 15th 08 02:04 AM
anyone has a routine to print envelopes from an existing XLS addr tiborp New Users to Excel 5 October 26th 07 03:39 PM
Print routine needed for code pano Excel Worksheet Functions 3 February 11th 07 02:27 PM
error routine Janis Excel Programming 2 September 20th 06 12:18 AM
vba routine to print a list of documents/worksheets Mirsten Choiple[_2_] Excel Programming 2 May 26th 05 12:00 AM


All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"