Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

starting Excel from Access

Status
Not open for further replies.

JeroenNL

Programmer
Nov 28, 2002
217
NL
Hi there,

Inside an Access macro, I start Excel with this line:

d:\blabla\excel.exe "e:\blabla\myworkbook.xls"

The workbook contains various worksheets. I want to be able to show one of these sheets when the workbook is opened. I thought about writing macros in the Excel workbook and call them from the commandline like this:

d:\blabla\excel.exe "e:\blabla\myworkbook.xls /m mymacro"

But this doesn't seem to work. How can I achieve what I want?




Bye,
Jeroen

A 3d level editor in Delphi
 
This is from an old thread where i asked nearly the same question (credit goes to xlbo)

Private Sub Command0_Click()
Dim objExcelApp As New Excel.Application
Dim objExcel As Object
'create Excel
Set objExcelApp = New Excel.Application
'open file
Set objExcel = objExcelApp.Workbooks.Open("PATH OF UR FILE")
objExcelApp.Visible = True
objExcelApp.Sheets("NAME OF UR SHEET").Select
Set objExcel = Nothing 'clears memory

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top