My VB.NET program works great on my machine, but on our 2003 server with Office 2007 installed the Workbooks.Add method fails with this mysterious exception.
I'm affraid that the excel's version matters. I had such experience before.
One of many ways (I hope) is to declare each excel object as object. Take a look at CreateObject function.
No, that is not .NET syntax. I don't remember how I fixed this, but it was not connected to any of the usual cases associated with that exception number.
I've not played with macros and such in office 2007 so I can't say anything for sure. Also I don't know if it still has the equivalent of vba, but if so open an excel workbook and try it in vba and see what is required of Workbook.Add. All vb.net is doing is sending the commands along to Excel so if it is right in Excel it will be right in vb.net.
-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.