View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Open file on a specified Worksheet

Private Sub Cmd_Sheet1_Click()
Dim bk as Workbook
Set bk = workbooks.Open(Filename:="MyFile.xls")
bk.Worksheets(1).Activate
end Sub

Private Sub Cmd_Sheet2_Click()
Dim bk as Workbook
Set bk = workbooks.Open(Filename:="MyFile.xls")
bk.Worksheets(2).Activate
end Sub


you can try the URL



You might look at this thread for other considerations (internet transfer
control, for example)

http://groups.google.com/groups?thre... icrosoft.com


--
Regards,
Tom Ogilvy


"Luis" wrote in message
...
No. I have a xls file with 2 sheets and i i have 2 options to open the

same
file, and i want that when the user chooses one option the file opens and
displays the corresponding sheet.

Tom, maybe you could help me on another question. I want to open a txt

file
on an FTP location. That FTP location has Username and password. Can i

pass
these parameters on the opening command? The problem is that i need to put
the username and password everytime i open the file. The site is allready
added to Excel.

"Tom Ogilvy" wrote:

What does that mean?

Do you want to import a text file into an existing sheet?

--
Regards,
Tom Ogilvy

"Luis" wrote in message
...
Hello.
How can i open a file on a certain worksheet?

Thanks
Luis