ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Different Path Selection (https://www.excelbanter.com/excel-programming/357313-different-path-selection.html)

sam[_7_]

Different Path Selection
 
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


Tim Williams

Different Path Selection
 
application.getopenfilename

Tim


"sam" wrote in message
oups.com...
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




sam[_7_]

Different Path Selection
 
Hi Tim,

But in this function i cannot give the input?

Please show me the code

Thank you,
Sunil


Ardus Petus

Different Path Selection
 
Snippet from VBA Help:

fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen < False Then
MsgBox "Open " & fileToOpen
End IfHTH--AP"sam" a écrit dans le message de
oups.com...
Hi Tim,

But in this function i cannot give the input?

Please show me the code

Thank you,
Sunil




Don Lloyd

Different Path Selection
 
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



"sam" wrote in message
oups.com...
Hi Tim,

But in this function i cannot give the input?

Please show me the code

Thank you,
Sunil




sam[_7_]

Different Path Selection
 
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


Tim Williams

Different Path Selection
 
Then why not just use an inputbox ? There is plenty of info in Help on
this.

--
Tim Williams
Palo Alto, CA


"sam" wrote in message
oups.com...
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




NickHK

Different Path Selection
 
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

"sam" wrote in message
oups.com...
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





All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com