Visual Basic application processing an Excel file


I have a visual basic application where I open an excel file and process the data in the file. I import Microsoft Office Interop at the beginning of my code to allow me to access the excel file. My application runs properly on my local development machine (which has excel installed on it) but gets a dialog error when I deploy it to my companies server (where it will reside and be launched every day by a scheduled task).

This is the error that I get when I try to run the application on the server:

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the 
COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} 
failed due to the following error: 80040154 Class not registered 
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean 
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& 
ctor, Boolean& bNeedSecurityCheck)at 
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, 
Boolean fillCache, StackCrawlMark& stackMark)
System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at VPA_password_database_update.Form1.convertCredFile(String testOrLive)
at VPA_password_database_update.Form1.Form1_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I installed my application on a co-workers machine (which has excel installed on it) and the application runs fine.

I believe excel is not installed on my companies server (where the application needs to reside).

I was under the impression that with the import of the Microsoft Office Interop, I would not need to have Excel installed on the machine running the application.

Is that impression incorrect?


asked on Stack Overflow Sep 12, 2019 by Jonathan Small

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0