VBA Excel Interface Not Registered - Runtime Error '-2147221163 (80040155)'

  • Thread starter Thread starter Taylor_L
  • Start date Start date
T

Taylor_L

Guest
Hello Everyone,

This is a recent problem that just appeared this morning. The code is a VBA macro from Solidworks that opens and reads an Excel sheet before returning back to SW. It's currently running fine on two other network computers, and was running fine on this one until this morning. Operating system is Windows 10.

Here is a snippet of the code: (error occurs on line three)

Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Sub main()

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc

Set xlApp = New Excel.Application
xlApp.Visible = False

Using this code for late-binding does not work either, however this brings up an ActiveX error.


Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Sub main()

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = False

This brings up an error "ActiveX cannot create object."

I've tried with different object libraries. The standard throughout the workplace is the Excel 14.0 object library. (Computer is currently running Excel 2019). I've tried with the Excel 16.0 object library and it made no difference.

Any thoughts on where this problem could be coming from?

Thanks in advance.

Continue reading...
 
Back
Top