Using Excel from Access



I want to use Automation to obtain properties from an Excel 97 workbook from
another Office App

Here is some code I tried. I need help getting it to work. When I run it, I
get an error message

"Run-time error '-2147417851 (80010105)' Method 'Open' of object
'Workbooks' failed"

The code is in an Access 97 form . OS Win XP
In the current database i have set a references to
Microsoft Excel 8.0 Objct Library
Microsoft Officel 8.0 Objct Library

I am able create a new instance of the Excel Application
But any manipulation of the App generates an error

The following code works, and I am able to create a new instance of Excel
I know this because I can observe Excel.Exe opening in the Windows Task
Manager

....but when attempt to use any of the commented out code to manipulate
Excel, the error mentioned above occurs

'Declaration section
Option Explicit
Dim xlApp As New Excel.application
Dim xlwbBook As New Excel.Workbook

Sub OpenExcelAndManipulate()

Dim stFile As String
stFile = "E:\New Files\Data.xls"

Set xlApp = New Excel.application
'xlApp.Visible = True

'Set xlwbBook = xlApp.Workbooks.Open(stFile)


End Sub
.



Relevant Pages

  • RE: Activating a renamed workbook
    ... Dim myInspector As Outlook.Inspector ... The go to tab Commands and select Macro. ... Then I can have a procedure in the main Excel application installing the ... because it activates the workbook always having the same name! ...
    (microsoft.public.excel.programming)
  • Re: xlTextPrinter and Accounting format
    ... My understanding, fwiw, is that when Excel creates a fixed width file the ... Dim sFileName As String ... Set WSHShell = CreateObject ... 'Make a duplicate copy of the active sheet to a new workbook ...
    (microsoft.public.excel.programming)
  • Re: Memory problem or Excel limitation
    ... I'm pretty sure that Excel is ... >>> Dim strPathAndWbk As String ... ' Calculate the folder and workbook names. ...
    (microsoft.public.excel.programming)
  • RE: CSV with greater that 256 Fields
    ... open the workbook from Access using automation. ... 'Loads the AdjustedActuals Excel spreadsheet into the AdjustedActuals table ... Dim varGetFileName As Variant 'Pass to Common Dialog to open workbook ... Dim strCurrMonth As String 'Used to build file name to open ...
    (microsoft.public.access.externaldata)
  • Re: ColorIndex vs Color?
    ... Compatibility mode means Excel won't try to put a value into cell ... Excel 2007 recognizes Excel 2003's palette, ... was assigned a customized palette in 2003, ... The source workbook just contains formatting information ... ...
    (microsoft.public.excel.programming)

Loading