View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] nottom04@gmail.com is offline
external usenet poster
 
Posts: 3
Default Opening a Excel file to a Specified Worksheet

After digging through some more posts, it seems like there is no easy
way to pass any sort of command line option into excel. (If there is
please let me know!)

As an alternative I did find a reference to a script that could open
the file and then run a macro <a href = "http://groups.google.com/
group/microsoft.public.excel.programming/browse_thread/thread/
a500b205bb204bd0/f38f7c0a98d20084?lnk=gst&q=reading+from+the+comman d
+line&rnum=29#f38f7c0a98d20084"here</a

Dim objxl, xlwbk
Set objxl = CreateObject("Excel.Application")
objxl.Visible = True
Set xlwbk = objxl.Workbooks.Open("mybook.xls")
objxl.Run ("OpenMySheet")

So I can write a couple different scripts (or better yet, write one
script that accepts command line arguments) like this for the various
worksheets I'd like to open to and then link to the script(s) instead
of the .