View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Using cmdlg xlDialogOpen

fname = Application.GetOpenFileName()
see help for options. This returns the users selection, but does not open
the file. You would use the information returned with

workbooks.Open fname
as an example it you want the file opened.

Also look at application.GetSaveAsFileName for similar funcitonality with
the saveas dialog.

--
Regards,
Tom Ogilvy


"PO" wrote:

My code needs to know the path and filename to a workbook for later use. The
info is to be provided by the user.

I tried to use:

Application.Dialogs(xlDialogOpen).Show

but that only returns the value true or false.

I still want the dialog to show but instead of true or false I want the
dialog to return the path and filename to the workbook. Also I don't want
the file to open - I just need the path info.

Any ideas?

TIA
PO