Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Change % Zoom and Save in Excel

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,36314
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Change % Zoom and Save in Excel
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Change % Zoom and Save in Excel - 7/19/2006 4:03:12 PM   
  takeda kozo

 

Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
Hey guys,

I would like to change the %'age zoom on my excel sheet and then save

Any ideas what I am doing wrong ? :(

I've flagged the dodgy line of my code. The script runs ok, but when opening the XLS file after completion of the script, the zoom is still sitting at 100% ???

Thanks ~

+++++++++++++++++++++++++

Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = False
oExcel.DisplayAlerts = False
Set oWorkbook = oExcel.Workbooks.Add
Set oWorksheet = oWorkbook.Worksheets(1)

oWorksheet.Cells(1, 1).Value = "HOSTNAMES"

oExcel.Worksheets(1).PageSetup.Zoom = 200  ' THIS LINE DOESN'T WORK

oWorkbook.SaveAs("c:\temp\report.xls")
oExcel.Quit

+++++++++++++++++++++++++

 
 
Post #: 1
 
 RE: Change % Zoom and Save in Excel - 7/19/2006 4:18:23 PM   
  ehvbs

 

Posts: 2222
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi takeda kozo,

the macro recorder told me:

    oExcel.ActiveWindow.Zoom = 200

Good luck!

(in reply to takeda kozo)
 
 
Post #: 2
 
 RE: Change % Zoom and Save in Excel - 7/19/2006 4:29:54 PM   
  takeda kozo

 

Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
GOd, i'm such an ****. It's been that long that i forgot all about the damn macro recorder

That line works a treat. Thanks very much



(in reply to ehvbs)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Change % Zoom and Save in Excel Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts