Stumped - VB6 Com Obj can't access MS Excel

  • Thread starter D. Shane Fowlkes
  • Start date
D

D. Shane Fowlkes

This most likely belongs in another forum but I thought I'd start here. I
have a COM Object written in VB6. The DLL will access MS Excel and use it's
Object Library to write a customized report and saves it to a folder. The
DLL even writes to a log for each step it takes so we can troubleshoot the
problems (if any).

This works fine on one machine but not another. The folder the DLL is trying
to write to has full permissions assigned to and is wide open. Furthermore,
the log txt file is being written in the same folder with no problems so I
know it's not a folder permissions issue. The problem seems to be when the
DLL tries to access MS Excel. The DLL is simple told "permission denied" by
Windows.

I would appreciate any pointers!
 
G

Guest

Permission denied to what? The Excel workbook? Directory? You don't know?

This is an off-the-cuff guess: are you creating multiple instances of Excel
and not quitting each one when done using the application?

Just a guess.

HTH,
 
D

D. Shane Fowlkes

I don't think so. It failed on the first attempt.

The best was I can describe it is that the DLL is being denied permission to
Excel itself. Excel is installed on the machine just for this function. The
log we have tracks every single move and action and seems to be denied
access to Excel immediately as soon as it tries to access it. I'm 99% sure
this isn't a folder permissions issue.
 
D

D. Shane Fowlkes

It works on two other servers. Nothing special was done to these other
servers.

Would I need to assign or check some obscure system user account like IWAM_
special permissions or something to the EXCEL.EXE file or something? Again,
I can find anything unusual on the machines it does work on.
 
G

Guest

So if you know that this web app runs on two other servers, the problem must
be on the third server. Does that DLL automate any other apps? As far as I
know, Excel doesn't require any special permissions to run. So see what else
is different. Compare IIS permissions; unregister and reregister the DLL;
etc.

Wish I could contribute more, but there are too many unknowns.
 
D

D. Shane Fowlkes

Thanks for your help. The problem is that the issue is on the live web
server which is run by a 3rd party. They're not inclined to address the
issue since it's such a special request. The best I can do is ask that they
check this and check that. But unless I know what is actually causing the
issues, I'm stuck. They're simply going to deny anything is wrong on their
since everything they keep checking ..things I blindy guess at....seems OK.
 
D

D. Shane Fowlkes

Source Code:


Public Function POPSpreadsheet(DB .) As Variant



'========================================================================

'Create the selected Program Of Projects reports on an Excel spreadsheet

'========================================================================



Dim xlApp As Excel.Application

Dim xlTemplate As Excel.Workbook

Dim xlSheet As Excel.Worksheet



'Begin Log entry

Call WriteLogFile(LOG_FILE_NAME,
"=============================================")

Call WriteLogFile(LOG_FILE_NAME, "Beginning POPSpreadsheet Function. DB
= " & DB)



'Open Excel

Call WriteLogFile(LOG_FILE_NAME, "About to begin Excel.")

Set xlApp = CreateObject("Excel.Application")

Call WriteLogFile(LOG_FILE_NAME, "Excel running.")







It seems to be failing on Set xlApp = CreateObject(("Excel.Application")





Thanks again
 
M

Mark Rae

This most likely belongs in another forum but I thought I'd start here.

Well, it clearly has little if anything to do with ASP.NET...

Did you try any of the VB6 forums? Or the Excel forums?
 
G

Guest

Shane,

Set a reference in your VB6 DLL to the Excel object library. Use that
referemnce when creating an Excel app object.

Dim xlApp as Excel.Application
Set xlApp = new Excel.Application

blah blah blah

xlApp.Quit
Set xlApp = Nothing

HTH,
 
D

D. Shane Fowlkes

Thanks Joe. Not my code but will try it out.



Joe said:
Shane,

Set a reference in your VB6 DLL to the Excel object library. Use that
referemnce when creating an Excel app object.

Dim xlApp as Excel.Application
Set xlApp = new Excel.Application

blah blah blah

xlApp.Quit
Set xlApp = Nothing

HTH,
 
L

logan

D. Shane Fowlkes said:
This most likely belongs in another forum but I thought I'd start here. I
have a COM Object written in VB6. The DLL will access MS Excel and use
it's Object Library to write a customized report and saves it to a folder.
The DLL even writes to a log for each step it takes so we can troubleshoot
the problems (if any).

This works fine on one machine but not another. The folder the DLL is
trying to write to has full permissions assigned to and is wide open.
Furthermore, the log txt file is being written in the same folder with no
problems so I know it's not a folder permissions issue. The problem seems
to be when the DLL tries to access MS Excel. The DLL is simple told
"permission denied" by Windows.

I would appreciate any pointers!

It sounds as though excel is indeed installed on the server.
This is just a guess, but you may have to use dcomcnfg to give permissions
to the interactive user.
Might be tough to do on someone else's server though.
 
D

D. Shane Fowlkes

Would you mind elaborating on the "interactive user"? You're on the right
track, Microsoft referrs to the dcomcnfg due to the error logged: 10003.

The server guys are in denial and I want to point them in the right
direction.

Thanks!!
 

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

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,832
Latest member
UtaHetrick

Latest Threads

Top