Excel automation failure on Windows Server 2003

Y

Yi

We have a VB.NET application that automates Excel (XP). This application runs
well under Windows XP. But when running on a Windows Server 2003, the
application would fail with an exception if no Excel instance is running. It
would work if the Excel is open before running it. Our code looks like:
-------------------------------------------------------------------
dim excelApp As Excel.Application
Try
excelApp = GetObject(Nothing, "Excel.Application")
If (excelApp Is Nothing) Then
excelApp = CreateObject("Excel.Application")
End If
Catch
End Try

myWorkbook = excelApp.Workbooks.Add
-------------------------------------------------------------------
It seems that the last line throws exception if Excel is not open before
running this code. I notice that after this application failure, there is
Excel process still running. And if in this case run our application again,
it would succeed. Is there any restrictions with Excel automation on a server
edition of Windows? Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top