#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default xldialog

Hello i created a xldialog so that the user can choose a file. Is there a
possibilty so that i get the path lies for example if he opens a file
Test.xls under D:\Test i need to get D:\Test\Test.xls .

Thanks alot in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default xldialog

Hi Philipp,

Try:

Sub Test2()
Dim fName As Variant
fName = Application.GetOpenFilename
MsgBox fName
'Workbooks.Open fName

End Sub

If you want to open the selected file, uncomment the penultimate line above


---
Regards,
Norman




"Philipp Oberleitner" wrote in message
...
Hello i created a xldialog so that the user can choose a file. Is there a
possibilty so that i get the path lies for example if he opens a file
Test.xls under D:\Test i need to get D:\Test\Test.xls .

Thanks alot in advance




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default xldialog

Forgot code :

Sub Auto_Open()

Application.Dialogs(xlDialogOpen).Show "F:\Test\Actis Scan"

End Sub


In there i need to get the full path and then close the file again

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default xldialog

what to do if i need to path to use it in another modul ?


"Philipp Oberleitner" schrieb im
Newsbeitrag ...
Forgot code :

Sub Auto_Open()

Application.Dialogs(xlDialogOpen).Show "F:\Test\Actis Scan"

End Sub


In there i need to get the full path and then close the file again

Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default xldialog

Use GetOpenFileName method instead, it returns a full file name.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Philipp Oberleitner" wrote in message
...
Hello i created a xldialog so that the user can choose a file. Is there a
possibilty so that i get the path lies for example if he opens a file
Test.xls under D:\Test i need to get D:\Test\Test.xls .

Thanks alot in advance






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default xldialog

Hi Philipp,

One way:

Sub Test2()
Dim fName As Variant
fName = Application.GetOpenFilename
Test3 fName

End Sub

Sub Test3(Filenme)
Workbooks.Open Filenme
End Sub


---
Regards,
Norman


"Philipp Oberleitner" wrote in message
...
what to do if i need to path to use it in another modul ?


"Philipp Oberleitner" schrieb im
Newsbeitrag ...
Forgot code :

Sub Auto_Open()

Application.Dialogs(xlDialogOpen).Show "F:\Test\Actis Scan"

End Sub


In there i need to get the full path and then close the file again

Thanks






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"