Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
I have a macro which moves to each worksheet and changes the page setup
properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
You may have meant to say If ws.Name < "Main" Then -- Don Guillett SalesAid Software "DevDaniel" wrote in message ... I have a macro which moves to each worksheet and changes the page setup properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
the code worked fine for me.
have you tried manually changing that setting on the recalcitrant sheets? -- Regards, Tom Ogilvy "DevDaniel" wrote: I have a macro which moves to each worksheet and changes the page setup properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
Also, if it is only the main sheet that is problematic, recall the Vergel
showed to set the zoom as well With ws.PageSetup .PrintQuality = 600 .Zoom = False '< == added line .FitToPagesWide = 1 .FitToPagesTall = False End With The zoom property can override Fit to print so you should set it explicitly to false. -- Regards, Tom Ogilvy "DevDaniel" wrote: I have a macro which moves to each worksheet and changes the page setup properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
Hi Tom,
I've tried with and without the zoom, but no luck. The worksheets that are causing the problem have a blank print quality (they are inserted by another process). I was using macro to change iprint quality to 600 dpi, but it is not working. "Tom Ogilvy" wrote: Also, if it is only the main sheet that is problematic, recall the Vergel showed to set the zoom as well With ws.PageSetup .PrintQuality = 600 .Zoom = False '< == added line .FitToPagesWide = 1 .FitToPagesTall = False End With The zoom property can override Fit to print so you should set it explicitly to false. -- Regards, Tom Ogilvy "DevDaniel" wrote: I have a macro which moves to each worksheet and changes the page setup properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
Like I said, it works for me. Does the print out look any different. As far
as I know, this is pretty much a dead setting, but I guess it would depend on the printer. -- Regards, Tom Ogilvy "DevDaniel" wrote: Hi Tom, I've tried with and without the zoom, but no luck. The worksheets that are causing the problem have a blank print quality (they are inserted by another process). I was using macro to change iprint quality to 600 dpi, but it is not working. "Tom Ogilvy" wrote: Also, if it is only the main sheet that is problematic, recall the Vergel showed to set the zoom as well With ws.PageSetup .PrintQuality = 600 .Zoom = False '< == added line .FitToPagesWide = 1 .FitToPagesTall = False End With The zoom property can override Fit to print so you should set it explicitly to false. -- Regards, Tom Ogilvy "DevDaniel" wrote: I have a macro which moves to each worksheet and changes the page setup properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
Thanks for your time and suggestions, guys. The issue appears to be
workstation-related, because the macro runs fine on other PCs in the office. "DevDaniel" wrote: Hi Tom, I've tried with and without the zoom, but no luck. The worksheets that are causing the problem have a blank print quality (they are inserted by another process). I was using macro to change iprint quality to 600 dpi, but it is not working. "Tom Ogilvy" wrote: Also, if it is only the main sheet that is problematic, recall the Vergel showed to set the zoom as well With ws.PageSetup .PrintQuality = 600 .Zoom = False '< == added line .FitToPagesWide = 1 .FitToPagesTall = False End With The zoom property can override Fit to print so you should set it explicitly to false. -- Regards, Tom Ogilvy "DevDaniel" wrote: I have a macro which moves to each worksheet and changes the page setup properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Works for Some Worksheets, But Not Others
I re-imaged my PC (reinstalling Excel 2003 and Acrobat 7.0). The code works
fine now. "DevDaniel" wrote: Hi Tom, I've tried with and without the zoom, but no luck. The worksheets that are causing the problem have a blank print quality (they are inserted by another process). I was using macro to change iprint quality to 600 dpi, but it is not working. "Tom Ogilvy" wrote: Also, if it is only the main sheet that is problematic, recall the Vergel showed to set the zoom as well With ws.PageSetup .PrintQuality = 600 .Zoom = False '< == added line .FitToPagesWide = 1 .FitToPagesTall = False End With The zoom property can override Fit to print so you should set it explicitly to false. -- Regards, Tom Ogilvy "DevDaniel" wrote: I have a macro which moves to each worksheet and changes the page setup properties. The code changes the properties on some worksheets, but not others. Have anyone had a similar problem? Is the file corrupt? I have tried - selecting all worksheets and changing the properties - looping through each worksheet and changing the properties Neither worked. Code snippet: Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Main" Then With ws.PageSetup .PrintQuality = 600 .FitToPagesWide = 1 .FitToPagesTall = False End With Else With ws.PageSetup .PrintQuality = 600 End With End If Next ws |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula works on all worksheets except for 2 | Excel Worksheet Functions | |||
Code somewhat works. Please help? | Excel Programming | |||
Why this code works and other do not? Newbie here. | Excel Programming | |||
Code works for any WBK except the PMW | Excel Programming | |||
Why won't this code works | Excel Programming |