ASP using a VB DLL to open an Excel workbook 
Author Message
 ASP using a VB DLL to open an Excel workbook

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!



Sat, 06 Dec 2003 03:45:49 GMT  
 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!



Fri, 12 Dec 2003 14:56:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Excel HRESULT: 0x800A03EC when using Workbooks.open or Workbooks._opentext in C#

2. How can I open Excel workbook without using Excel.Worksheet

3. Excel 97/2000: making custom functions (in a hidden workbook) available to all open workbooks

4. Open Excel workbook using ADO

5. Excel Workbook takes too long to open in Excel 2000

6. Opening a Excel 5.0 Workbook with VB Code

7. Opening Excel Protected workbooks from vb

8. VB check if the Excel Workbook already open

9. how delete a macro within an Excel Workbook by using VB

10. Using Excel workbooks from VB

11. how delete a macro within an Excel Workbook by using VB

12. write EXCEL Workbook from ASP

 

 
Powered by phpBB® Forum Software