Different Path Selection

S

sam

Hi,

I would like to open a file but the path name should be given in the
input box

fox example:


Workbooks.Open Filename:="\\10.10.10.4\x\y\z\a\PRODUCTION REPORT.xls"

here a should be the input message.

Can any one hlep

Thanks
Sam
 
S

sam

Hi Tim,

But in this function i cannot give the input?

Please show me the code

Thank you,
Sunil
 
A

Ardus Petus

Snippet from VBA Help:

fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen <> False Then
MsgBox "Open " & fileToOpen
 
D

Don Lloyd

Hi,

The following is taken from a macro that I use to save to a pre-determined
location.


Dim Fname, Suggested, Hdr, Fs, Res
Suggested = ThisWorkbook.Path & "\" & "Schedules " & Format(Date, "dd mmm
yy")
Hdr = "Please choose a Destination and a Name for your file, then click
Save."
GetFname:
Fname = Application.GetSaveAsFilename(Suggested, fileFilter:="Excel File
(*.xls), *.xls)", Title:=Hdr)
.. . . . . .

'Suggested' is the path that appears as 'default'.. It can be whatever you
want.

Don
 
S

sam

Hi,

I have to collect the data from a path whether the path should be given
in inputbox and i have to process few datas

thank You,
Sam
 
N

NickHK

sam,
It seems I'm not the only one confused by what you want.
If you want the user to select a file, then open that file, use
Application.GetOpenname.
(You could use an input box, but why, when you have better alternative.)

If the user has no choice, then why display anything ?

NickHK
 

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