Re: Open Excel then a spreadsheet?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: James T. (anonymous_at_discussions.microsoft.com)
Date: 04/21/04


Date: Wed, 21 Apr 2004 06:04:51 -0700

The "s" worked! Details, details, details! Thanks to Gina
too for responding and the detailed response from Ken. I
really appreciate this group!

James

>-----Original Message-----
>Private Sub Command10_Click()
>
> ' start Microsoft Excel.
> Set excelApp = CreateObject("Excel.Application")
>
> With excelApp
>
> ' Make the application visible.
> .Visible = True
> ' Open the document.
> .Workbooks.Open "C:\DataLetters\SpreadsheetTest.xls"
>' etc. etc. etc.
>
>If you use the CreateObject, you do not need to include
reference to EXCEL
>in References. ACCESS will do this when it creates
excelApp object (called
>"late binding"). This actually is preferred over "early
binding" (declare
>reference to EXCEL in the application's References)
because late binding
>doesn't require you to know which version of EXCEL is
running on the
>machine.
>
>--
> Ken Snell
><MS ACCESS MVP>
>
>
>"James T." <anonymous@discussions.microsoft.com> wrote in
message
>news:1d0201c42723$9f3732f0$a101280a@phx.gbl...
>> I had tried spreadsheet and it didn't work, so I just
>> tried your suggestion, Workbook, and it didn't work
>> either. Thanks for the suggestion, though!
>>
>> James
>>
>> >-----Original Message-----
>> >I THINK you hav eo use .Workbook.Open instead of
>> >Document.Open for Excel
>> >
>> >>-----Original Message-----
>> >>Using Access 2000
>> >>
>> >>I use the following code with Word a lot:
>> >>
>> >>Private Sub Command10_Click()
>> >>
>> >> ' start Microsoft Word.
>> >> Set wordApp = CreateObject("Word.Application")
>> >>
>> >> With wordApp
>> >>
>> >> ' Make the application visible.
>> >> .Visible = True
>> >> ' Open the document.
>> >> .Documents.Open
>> >>("C:\DataLetters\NoticeToProceed.doc")
>> >>
>> >>I have tried the same thing recently with Excel with:
>> >>
>> >>Private Sub Command10_Click()
>> >>
>> >> ' start Microsoft Excel.
>> >> Set excelApp = CreateObject("Excel.Application")
>> >>
>> >> With excelApp
>> >>
>> >> ' Make the application visible.
>> >> .Visible = True
>> >> ' Open the document.
>> >> .Documents.Open
>> >>("C:\DataLetters\SpreadsheetTest.xls")
>> >>
>> >>Excel opens, but not the spreadsheet.
>> >>
>> >>Any help greatly appreciated.
>> >>
>> >>Thanks,
>> >>
>> >>James
>> >>
>> >>
>> >>.
>> >>
>> >.
>> >
>
>
>.
>



Relevant Pages

  • Re: Open Excel then a spreadsheet?
    ... >too for responding and the detailed response from Ken. ... >> ' start Microsoft Excel. ... >excelApp object (called ... >>reference to EXCEL in the application's References) ...
    (microsoft.public.access.forms)
  • Re: VS2005 vb.net DLL - interop EXCEL
    ... where you are actually working with Excel via ComInterOp ... .NET CLR to release it's reference to the underlying COM object: ... Dim xlAppl As Excel.Application ... It has to do some work with Excel files, so I created a DLL in VS2005. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VS2005 vb.net DLL - interop EXCEL
    ... an explicit Worksheet object reference and don't actually get a Worksheet, ... Dim xl As New Excel.Application ... 'Set up explicit Excel object references... ... xlSheet = xlSheets ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VS2005 vb.net DLL - interop EXCEL
    ... Dim xl As New Excel.Application ... 'Set up explicit Excel object references... ... xlSheet = xlSheets ... 'This causes the COM reference counts to go to zero and then COM will ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VS2005 vb.net DLL - interop EXCEL
    ... Dim xl As New Excel.Application ... 'Set up explicit Excel object references... ... xlSheet = xlSheets ... 'This causes the COM reference counts to go to zero and then COM will ...
    (microsoft.public.dotnet.languages.vb)