Open excel 2007 with a certain worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the start command syntax if I want to open a Excel 2007 workbook with
a certain worksheet ? ( Not the standard "Sheet1" )
 
In a macro???

Option Explicit
Sub Auto_Open()
application.goto thisworkbook.worksheets("sheet9999").range("a1"), _
scroll:=true
End Sub
 
How would excel/windows know what worksheet to start on--if you have 37 excel
workbook with scheduled activities--and each of those could have multiple
differently named worksheets.

In a specific workbook, you could use a macro to specify which worksheet to
start on.
 
Well, that´s what I would like to tell Excel in the command prompt.
For example: something like c:\program\excel.exe
c:\folder\myworkbook!sheet9999.xls
Perhaps it´s not possible ?

"Dave Peterson" skrev:
 
Put the sheet selecting macro IN the workbook. When the workbook opens
the desired sheet will be the active one.
Well, that´s what I would like to tell Excel in the command prompt.
For example: something like c:\program\excel.exe
c:\folder\myworkbook!sheet9999.xls
Perhaps it´s not possible ?

"Dave Peterson" skrev:
 
The background is:
I have a workbook with 5 worksheets named "Monday",
"Tuesday","Wednesday","Thursday" and "Friday".
I want the Windows "Scheduled activities" to open this book with the sheet
"Monday" every monday at a specific time. After opening the sheet, it should
connect to an external database and automatically update the data . On
tuesday I want the workbook to open the sheet "Tuesday" and so on.
I am not sure the "macro" way is the best one.

"Bob I" skrev:
 
If you have a macro like this in that workbook, then the worksheet that matches
the name of the day of the week will be selected:

Option Explicit
Sub auto_open()
On Error Resume Next
Application.Goto ThisWorkbook.Worksheets(Format(Date, "dddd")).Range("a1")
If Err.Number <> 0 Then
Beep
Err.Clear
End If
On Error GoTo 0
End Sub

I have no idea how you would connect to that external database and update what
you need updated.


The background is:
I have a workbook with 5 worksheets named "Monday",
"Tuesday","Wednesday","Thursday" and "Friday".
I want the Windows "Scheduled activities" to open this book with the sheet
"Monday" every monday at a specific time. After opening the sheet, it should
connect to an external database and automatically update the data . On
tuesday I want the workbook to open the sheet "Tuesday" and so on.
I am not sure the "macro" way is the best one.

"Bob I" skrev:
 
Back
Top