
Can I open a specific Excel file from within Access
Actually, FWIW, if you were to modify that snippet as
Dim xlAppl as Object
set xlAppl=CreateObject("Excel.Application")
xlAppl.Workbooks.Open "C:\SomeWork.xls"
you then won't need to set a reference to Excel library.
OTOH, if you rewrote it as
Dim xlAppl as Excel.Application
set xlAppl = New Excel.Application
xlAppl.Workbooks.Open "C:\SomeWork.xls"
then you would need the reference.
The code to open the workbook itself remains the same in either case.
HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------
:Create a VBA eventprocedure with the following code:
:
:Dim xlAppl as Excel.Application
:Set xlAppl = CreateObject("<location of excel file>")
:
:Be sure to have set a reference to the Excel object library (via Tools -
References)
:
:> Hi there
:>
:> I would like to be able to open a specific Excel file from within Access
:> using a button on a form
:>
:> Help
:>
:>
:>
:>
:>