Open to Specific Excel Tab

D

Dan

I am export data from a 2003 acess base to an Excel file which opens up on
the end users desktop. Only problem I have is that when it opens it opens to
the last tab the last person viewed/saved. I am sure there is a way to open
the workbook to a specific sheet but I cant seem to find it. Thanks in
advance.

Current code being used is:

ExcelFile = "c:\My Info.xls"
OpenExcel = Shell("Excel.exe " & """" & ExcelFile & """", 3)

want to open to "My_Data" sheet

Cheers
 
R

Ralph

Dim xlApp As Object
Dim xlWb As Object
Dim ExcelFile As String
ExcelFile ="c:\My Info.xls"
Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.workbooks.Open(ExcelFile)
xlWb.worksheets(1).select
xlApp.Visible = True
 
Top