
ASP using a VB DLL to open an Excel workbook
Hi Jason,
How are you instantiating the Excel application? I'm assuming you're using
early binding. However, you're using Excel.Workbooks instead of explicitly
using an existing or new Excel application object. Here's how I would do
it:
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = New Excel.Application '/ or use GetObject to
'/ get existing
instance
Set xlWB = xlApp.Workbooks.Open(sFilename, False)
'/ your code here
xlWB.Close SaveChanges:=False
Set xlWB = Nothing
xlApp.Quit '/ leave out if you don't want to close Excel
Set xlApp = Nothing
Regards,
Jake Marx
I have a VB DLL that opens an Excel Workbook. Using a VB test harness, I
can
access all of the functionality in the DLL. I need to use ASP to access the
DLL
to interact with the Excel workbook. I can use ASP to access some
functionality
of the DLL (e.g. 'Hello World'). However, when I use ASP to tell the DLL to
open
the Excel workbook, the DLL never returns from the following statement:
Dim varWorkbook As Excel.Workbook
Set varWorkbook = Excel.Workbooks.Open(varFileName, 0)
Any input would be greatly appreciated. Thanks!