Open to Specific Excel Tab

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top