Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can not open excel worksheet in vbscript.

Status
Not open for further replies.

dabiri

Technical User
Dec 8, 2014
33
US
hi,
I had a vbs application that used this with excel 2008
they installed excel 2013 on our machines and now the code below doesn't work:
Code:
Set objExcel = CreateObject("Excel.Application") 
msgbox "excel application started" 
objExcel.DisplayAlerts = 0 
objExcel.Workbooks.open excelfile, false, true
[/codd]
any ideas on how to make this work?
thanks.
 
And what error you get if you try to run the script?
For example, look at the file path in the variable excelfile.
Does the file path in the variable above really exists? Didn't the location of the excel file changed ?
 
Code:
Set objExcel = CreateObject("Excel.Application") 
[highlight #FCE94F]objExcel.Visible = True[/highlight]
msgbox "excel application started" 
objExcel.DisplayAlerts = 0 
objExcel.Workbooks.open excelfile, false, true

Note that you don't show where you are defining the excel file to open so be sure that is defined.

I hope that helps.

Regards,

Mark

No trees were harmed in posting this message, however a significant number of electrons were terribly inconvenienced.

Check out my scripting solutions at
Work SMARTER not HARDER.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top