First, create excel instance:
[tt]set xlApp=CerateObject("Excel.Application"[/tt]
open excel workbook:
[tt]set xlWbk=xlApp.Workbooks.Open("c:\MyWorkbook.xls"[/tt]
make it visible:
[tt]xlApp.Visible=True[/tt]
(select a sheet if necessary:
[tt]xlWbk.Sheets(3).Select[/tt])
set preview mode:
[tt] xlWbk.PrintPreview
Don't forget to set a reference to the Excel library prior to using the code.
From the code window, click Tools/References/ and put a check mark by Microsoft Excel (whatever version number) and click OK.
hi,
I am having a similiar problem.
I need to get to the worksheets which have there own names like "ER0102". I could not understand the code posted by SBendBuckeye.
Should be CreateObject
No ) after .Select
xlWbk.Sheets("YourSheetName".Select 'Can use name or number
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.