Go to specific worksheet using command line switches

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

Bill Titus

Using a complete command line at "Start | Run" - NOT from within Excel
itself.

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"

JAN05 is one of 24 worksheets in the workbook.

Any help will be much appreciated.
 
Assuming N:\Calendars\PlanningCalendar.xls#JAN05!A1 is the path and file
name of your worksheet, simply put that string in the "Run" field of the
Start Menu, click OK and it should automatically start Excel and pop up the
desired worksheet.

Regards,

PJF
 
BTW, this apparently will not work if you use the CMD command in the RUN
window and then try to execute the file using the path and file name in the
DOS window.
 
After some experimenting, I found that it is possible to open a specific
Excel worksheet directly from the DOS command line WITHIN a DOS window. I
used the following batch file:

*SpellNumber.bat
Echo Off
Cls
c:\test\spellnumber.xls
pause
exit

Where the executable is named SpellNumber.bat and "c:\test\spellnumber.xls"
is the path and file name. Be sure to put the Excel worksheet in a directory
with a name DOS can recognize. I originally had it in a directory named
"Excel Docs" and that resulted in an error. So, best to use a directory
with a single name. Of course, you can name the batch file anything you
want; ditto for your directory and file names providing they can be
recognised by DOS. Hope this helps. Note that I did this in Excel 2000
running Windows 2000 Pro. If you're running a different configuration, your
results may vary! <g>

PJF
 
PJF

You're going through a lotta work to open an Excel WORKBOOK, but the OP wished
the WORKBOOK to open with a specific WORKSHEET and specific cell activated.

This step can be done only through VBA code.

Gord Dibben Excel MVP
 
Back
Top