Open a Workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I need to create a VBA macro to will allow to select and open a workbook to
activate it.
The name of the workbook will change. The name cannot be fixed.
Thanks,
 
Jeff

Something like this will work...displays Excel's open dialog, stores the
file selected and opens the workbook

Sub OpenWorkbok()
Dim fName As String
fName = Application.GetOpenFilename()
Workbooks.Open Filename:=fName
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Thank you


Nick Hodge said:
Jeff

Something like this will work...displays Excel's open dialog, stores the
file selected and opens the workbook

Sub OpenWorkbok()
Dim fName As String
fName = Application.GetOpenFilename()
Workbooks.Open Filename:=fName
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Back
Top