command line switch to open a specific worksheet?

P

Paul B

Is there a way to open a specific worksheet in a workbook using command
line switches?

I'm trying to create a menu selection in AutoCAD that will open an Excel
workbook to a specific worksheet inside of that workbook. Typing the
command "start" <CR> followed by "Excel /filename/" <CR> will open that
particular file, but how do I get it to open to a specific worksheet?

Thanks for any help,
Paul
 
J

Jim Rech

There's no command line switch that will activate a worksheet. You have to
do one of the following:

-Save the workbook with the desired sheet active. Excel will open it
active.

-Put a macro in the workbook to activate the sheet. This would go in the
Workbook_Open event handler in the ThisWorkbook module.

-If AutoCad supports automation write a routine that uses automation to
create an instance of Excel, open the workbook, and activate the worksheet.
You'll find a lot of information on automating Excel and Office apps here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;302460&Product=xlw
 

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