Open workbook to a specific sheet

  • Thread starter Thread starter Bill Titus
  • Start date Start date
B

Bill Titus

What form of filename and switches will allow me to call a workbook and open
it to a specific worksheet and, if possible, a specific cell. I've tried the
following without success:

"C:\Program Files\Microsoft Office\Office\EXCEL.EXE"
"N:\Calendars\PlanningCalendar.xls#JAN05!A1"

Any help will be much appreciated.
 
why not just use the workbook_open event in the ThisWorkbook module or
auto_open in a regular module?
 
Bill,

='N:\Calendars\[PlanningCalendar.xls]JAN05'!A1

in a cell should get you there, use a range if you have to see the whole
calendar...

Brian
 
Thanks, Don.

I'm afraid that "modules" doesn't resonnate with me.

I'm looking for a command line solution. If I can pass parameters from a
command line to a startup macro that accomplishes what I want, what would
the command line and the macro look like?

Bill
 
Sorry. I misunderstood what you were asking....

Try Google "command line" and "specific cell"


Beege said:
Bill,

='N:\Calendars\[PlanningCalendar.xls]JAN05'!A1

in a cell should get you there, use a range if you have to see the whole
calendar...

Brian


Bill Titus said:
What form of filename and switches will allow me to call a workbook and
open
it to a specific worksheet and, if possible, a specific cell. I've tried
the
following without success:

"C:\Program Files\Microsoft Office\Office\EXCEL.EXE"
"N:\Calendars\PlanningCalendar.xls#JAN05!A1"

Any help will be much appreciated.
 
Bill

You cannot call a macro from a Command line.

You must place the code in a Workbook_Open Sub in ThisWorkbook or an Auto_Open
Sub in a General module.

You then open the workbook from the Command line and the macro runs.

Sub Workbook_Open()
Sheets("MySheet").Activate
'if want a specific cell add
Range("G23").Select
End Sub

See Excel's Help for "startup switches" to get the command line to open a
workbook.

Or just make a shortcut to the file by pointing to it.

Gord Dibben Excel MVP
 
Back
Top