Open file on a specified Worksheet

G

Guest

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.
 
T

Tom Ogilvy

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

ftp://username:password@server/folder/file.txt

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

http://groups.google.com/groups?threadm=#xpeshb2#[email protected]
 

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