Message 1 of 2
Unable to open Excel from VBA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have AutoCAD 2021 installed on my machine with Office 2010 (bit old of course). When I am trying to open a spread sheet in the background with the following code to read some data I am using for drafting the system hangs.
Set excelApp = GetObject(, "Excel.Application")
If Err <> 0 Then
Err.Clear
Set excelApp = CreateObject("Excel.Application")
If Err <> 0 Then
MsgBox "Could not start Excel", vbExclamation
End
End If
End If
In task manager, I notice that program is actually running latest Excel.
The reference is set to Microsoft Excel 16.0 Object Library,
Anybody knows, how to open Excel 2010 instead of the latest version? Is reference to Excel 2010 is different? If yes, what reference I need to set to?
Thanks,
Nimish