Hope somebody knows how to do this, i'm none too good with VBA.
I have Excel 2016 (64bit) and Excel 2010 (32bit) installed on my machine. This is because i have some older excel based tools that only function in 2010. One of these tools contains the following code:
Start:
ThisWorkbook.Activate
strOutputsFilePath = gStrOutputsPath
strDMfilename = [DMFilePath]
'2. Refresh the PowerPivot model with the new data
'Create a new instance of excel
Application.StatusBar = "Opening a new instance of MS Excel"
Set appExcelApp = New Excel.Application
'Disconnect and Re-connect to the PowerPivot Add-in (in case it has been disconnected)
For Each comAddin In appExcelApp.COMAddIns
If comAddin.Description = "PowerPivot for Excel" Then
Set comAddinPPVT = comAddin
End If
Next
If Not comAddinPPVT Is Nothing Then
comAddinPPVT.Connect = False
comAddinPPVT.Connect = True
End If
'Apply the settings for the Excel application
With appExcelApp
.Visible = False
.ScreenUpdating = False
.DisplayAlerts = False
.EnableEvents = False
End With
What the app is supposed to do is run a new instance of Excel 2010 and open certain files in it. However, after installing 2016, the New Excel.Application command defaults to opening Excel 2016 instead of 2010. This produces an error with the PowerPivot addin because of incompatibility between data models.
Question is: Is there a way to specify in the VBA code that i want an instance of Excel 2010?
Tried to make Excel 2010 default on my system however the code still opens 2016 and errors out :\
Any help is greatly appreciated!
Thanks
CreateObject("Excel.Application.14")
to instantiate Excel 14 (which I think is 2010). – Joe