Solved

Problem launching Excel from server

Posted on 2001-09-03
10
230 Views
Last Modified: 2012-06-21
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...
0
Comment
Question by:meeker
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 6451806
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.
0
 
LVL 1

Author Comment

by:meeker
ID: 6452752
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.
0
 
LVL 10

Expert Comment

by:dij8
ID: 6452900
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.
0
 
LVL 5

Expert Comment

by:raizon
ID: 6453123
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?

0
 
LVL 1

Author Comment

by:meeker
ID: 6453145
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!

Matt
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 19

Expert Comment

by:webwoman
ID: 6453216
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.
0
 
LVL 5

Accepted Solution

by:
raizon earned 300 total points
ID: 6453256
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


Err_Handler:

  sample = Err.Description & Err.Source

End Function
0
 
LVL 1

Author Comment

by:meeker
ID: 6454736
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.
0
 
LVL 1

Author Comment

by:meeker
ID: 6456377
Raizon

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
0
 
LVL 5

Expert Comment

by:raizon
ID: 6456923
thank you for the points, grade and comments.  I'm glad it worked out.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now