Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening a Excel file to a Specified Worksheet

I'm helping to lay out a simple webpage to allow users easy access to
a few excel workbooks that contain all sorts of interesting things
they might like to look at. Some of the workbooks are pretty
overwhelming, so I'd like to link to the worksheets that contain the
data the general public would find interesting (i.e. charts, and data
summary sheets)

I'd like a way to open a workbook to a worksheet specified in the
command line if possible. I can write a macro that opens a designated
worksheet, but I don't know how to get it to read a command line
argument.

Any help would be greatly appreciated.

Thanks,
Thomas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Opening a Excel file to a Specified Worksheet

You could either place hyperlinks on the sheet along with text explaining
what to expect when going to each sheet, and hyperlinks on each sheet taking
them back to the original, or you could create some code that would "demo"
the sheets of interest:

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10 ' (seconds)
waitTime = TimeSerial(newHour, newMinute, newSecond)

Sheets(12).Range("A1").activate
Application.Wait waitTime

Sheets(23).Range("A1").activate
Application.Wait waitTime

You could include activating specific ranges on each sheet with the "wait"
command set for the time you think appropriate and go from there to make the
presentation as complex as you wish.

--
Best wishes,

Jim


" wrote:

I'm helping to lay out a simple webpage to allow users easy access to
a few excel workbooks that contain all sorts of interesting things
they might like to look at. Some of the workbooks are pretty
overwhelming, so I'd like to link to the worksheets that contain the
data the general public would find interesting (i.e. charts, and data
summary sheets)

I'd like a way to open a workbook to a worksheet specified in the
command line if possible. I can write a macro that opens a designated
worksheet, but I don't know how to get it to read a command line
argument.

Any help would be greatly appreciated.

Thanks,
Thomas


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Opening a Excel file to a Specified Worksheet

You could write the link something like

Click <a href="C:\Book1.xls#TheSheet"Here</a to open file.</p

change the path of the workbook name to file name, either local or on a
network share.

Or you can use VBA code in the ThisWorkbook code module of the target file
such as

Private Sub Workbook_Open()
Me.Worksheets("TheSheet").Select
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

wrote in message
oups.com...
I'm helping to lay out a simple webpage to allow users easy access to
a few excel workbooks that contain all sorts of interesting things
they might like to look at. Some of the workbooks are pretty
overwhelming, so I'd like to link to the worksheets that contain the
data the general public would find interesting (i.e. charts, and data
summary sheets)

I'd like a way to open a workbook to a worksheet specified in the
command line if possible. I can write a macro that opens a designated
worksheet, but I don't know how to get it to read a command line
argument.

Any help would be greatly appreciated.

Thanks,
Thomas



  #4   Report Post  
Posted to microsoft.public.excel.programming
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 .

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a excel file to a specific worksheet. istanley24 Excel Discussion (Misc queries) 1 September 10th 09 07:30 AM
opening new csv file in existing xls file's worksheet Shikha Excel Worksheet Functions 4 March 2nd 09 12:56 PM
Grey screen on one worksheet when opening excel file Belinda7237 Excel Discussion (Misc queries) 1 July 9th 08 01:15 PM
Opening Excel file on a specific worksheet sdhaight Excel Worksheet Functions 7 December 7th 06 09:30 PM
Opening an excel file returns a blank worksheet JVenner Excel Discussion (Misc queries) 4 October 15th 06 02:27 AM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"