I'm working with a web application that performs some Excel automation (I know - not a preferred solution).
I am using Excel 2007 as my development platform but the target server uses Excel 2003. After experiencing a lot of headaches with the Excel 12 interop trying to be loaded on the target server even though I expressly selected Excel 11 during development, I have resorted to using late binding rather than early binding.
This has allowed me to get as far so as to instantiate Excel (and I can see the Excel process start in task manager on the target server).
However I am unable to invoke the Open method of the late-bound Workbooks object. It throws this error at me:
"Unable to get the Open property of the Workbooks class"
I have been experimenting with a few different things and have tried the following:
In all three cases, the Excel automation succeeds. It's only when I deploy the ASP.NET application that this error crops up. In a very simplified form, the code resembles:
Dim xlApp As Object 'Excel.Application
Dim xlBook As Object ' Excel.Workbook
xlApp = CreateObject("Excel.Application") 'New Excel.Application
xlBook = xlApp.Workbooks.Open("somefile.xls", , True, , , , , , , , , , , , False)
Does anyone have any ideas as to what might be happening? I checked the user that the Excel process starts as, and it is the same user that I successfully ran the Windows Forms .NET application as successfully. I had already opened Excel as this user to clear all the initial setup stuff.
I'm getting this same problem and I found some sites saying the following: Try going to file - options - add-ins - select diabled add-ins in the manage dropdown - click go - and enable anything in there.
It didn't work for me but it might for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With