Problem launching Excel from server

Hi kind people - I wonder if you can help with the following...

I have written a simple DLL in VB6. The DLL opens Excel97, puts some values on a worksheet, runs the chart wizard and then saves the chart generated as a gif file. This gif file is then going to be displayed within a web page.

I am instantiating the DLL from some server side script in an ASP page, and this all works fine on my development server.

Unfortunately when moving the application to a test server, this functionality no longer works. When the users navigate to the web page with this ASP code on, they get the error message:

Method '~' of Object '~' Failed (800a03ec).

The DLL is called directly from the ASP page (i.e. not using MTS) and the asp apge runs under IIS.

I know that Excel is installed and working on the test server, and that my DLL is correctly installed / registered ( I can run a VB compiled EXE which calls the same DLL with no problems).

I have looked through MSDN and Technet with no luck so far. I thought that it could be permissions related - I have tried the following:

Created a user with access rights to log on locally to the server. Logged on as that user and checked could access Excel / the DLL. In IIS Admin, for the web page I am using, set the properties, then file security to allow anonymous access and to use the special user i created.

What is particularly annoying is that it worked fine in development, and I can't find any differences between the development server and the test server!!!

Anyone who can solve this will be worth their weight in gold!

thanks in advance for your help...
Who is Participating?
raizonConnect With a Mentor Commented:
It looks to me like you are missing a dll on the test server, or something that your DLL is calling is missing on the DLL server.  

In your VB code with in that Function that instatiates the DLL add some error handling that will throw the error back to the ASP page so we can see what that is.

Public Function sample()

On Error Goto Err_Handler

'vb code


  sample = Err.Description & Err.Source

End Function
Give the IUSR-maachine user permissions on that folder, and allow them to write to the directory and run the dll. Chances are they don't have permission to do so -- and that's the user that's going to be accessing it.
meekerAuthor Commented:
Thanks for the suggestion. We have already looked at permissions and believe that the above is not the problem - i can log on as the IUSR_Machine user and run the test exe program which calls the DLL without a problem.
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Does your ASP code include any quotes? If it does then you may need to look at changing single quotes to \'.  Or maybe look at the same thing inside the DLL code.
Is the development server your local machine? if so then I would say we are dealing with a permissions issue.  

If not then I have a tendancy to believe that its not a permissions issue.

What is the entire error?

If it worked fine on the development server but isn't on the test server then we are dealing with something that is different between the two.  Look at Service Packs that are installed, VBRuntime files make sure that both environments are the same.  Does your DLL call any other dll's/files that are possibly not installed on the Test server? Did you create an install package to install the DLL on the test server to ensure that wasn't the case?

meekerAuthor Commented:
Thanks for the comments - here is some further information which may be of help....

The development server is a separate win nt4 server with IIS 4 - as far as we can see with the same build as the test server.

The DLL appears to be instantiated correctly within the ASP page (i.e. it's not the server.createobject line which generates the error but rather the function within the DLL which I've written) and as I said before, the dll works fine on the server if run from an exe, so we know it's installed correctly and working correctly. The page also runs fine on the test server, so I know the ASP code isn't at fault - the problem must be related to something on the server, but quite what I don't know!

The actual error is that the web page is displayed as follows:

HxASPPieChartDrawing error '800a03ec'

Method '~' of object '~' failed

/execsummary-print.asp, line 29

Line 29 in my asp page is the line which calls the function in the DLL which instantiates Excel.

Thanks again for your help!

Are you trying to print? If so, web printing is probably turned off if not completely deleted. It was one of the security holes, so most places got rid of that real fast.
meekerAuthor Commented:
Webwoman: No I'm not trying to print - the page is meant to be a "printable version" - i.e. it's in black and white which is why the asp page has the word print in the name.

Raizon: That's a good suggestion - thanks - I will try that when I am back at work tomorrow.
meekerAuthor Commented:

Thank you for this suggestion - it allowed me to narrow down my problem to the line which tried to save the file to the hard disk - this then prompted me to realise that the test server has a different directory structure, so the ASP page calling this DLL should have passed a different filename. I have now corrected this mistake and all is working well. It's a shame that VB/IIS can't give a more meaningful error message (even with the error handling code in, VB returned the same error message with code 1004). Still this has been an excellent learning exercise in ASP /DLL debugging and I'm very grateful for your help - well worth the 300 points.

Thanks again
thank you for the points, grade and comments.  I'm glad it worked out.
All Courses

From novice to tech pro — start learning today.