Link to home
Start Free TrialLog in
Avatar of Ryan Simmons
Ryan Simmons

asked on

vbscript to refresh excel data connections specifying 2013

Good Morning,

I have the following vbscript:

Set oexcel = CreateObject("excel.Application")
Set oWorkbook = oexcel.Workbooks.Open("C:\Analytics\Access Databases\Workforce Management\WFMR\Exports\EXCEL\OLAP\2016\OLAP_1216.xlsm")

oexcel.Application.Visible = False
oexcel.ActiveWorkbook.RefreshAll
oexcel.ActiveWorkbook.Save
oexcel.ActiveWorkbook.Close
oexcel.Application.Quit

set oexcel = nothing
set oWorkbook = nothing

Open in new window


The problem is that I have both 2007 and 2013 installed on my machine which is required because all of my customers use 2007 and I need to make compatible worksheets. When I run the script it uses 2007 to refresh the document. Is there a way I can specify to the script that it needs to use 2013?
ASKER CERTIFIED SOLUTION
Avatar of Frank Helk
Frank Helk
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ryan Simmons
Ryan Simmons

ASKER

Thanks guys. I moved the script to a alternate machine that only has 2013 installed. I will eventually have 2007 uninstalled from my machine. But for now the alternate PC can run the script and refresh the documents.
Great feedback and solution.