Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open spreadsheet via inputbox

Status
Not open for further replies.

mash100

Technical User
Sep 6, 2004
3
GB
can anyone tell me how to open a certain spreadsheet by typing the filname into an inputbox?

Thanks in advance!
 




Why go to all the trouble of typing?

Check out the GetOpenFileName method of the application object.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks for the reply Skip, im wanting to do some VBA work on a certain spreadsheet that the user will know the filename of without having to browse through the files as there may be many.

thanks.
 




Believe me; I know my filenames, too, but I NEVER type a filename for an existing file, cuz you ALSO need to type in the entire path as well!!!

But here's a keyboard-intensive example, and I'd be cursing the coder...
Code:
    Dim FName
    FName = InputBox("Enter File Path\name")
    If FName <> "" Then
        Workbooks.Open FName
    Else
        MsgBox "Can"
    End If


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top