reference for OpenFileDialog

  • Thread starter Thread starter MattE
  • Start date Start date
M

MattE

From within my excel VBA code I need to open another spreadsheet so am
using OpenFileDialog (unless there is there a better way?) but can't
get it to be recognized. What reference do I need to add for the file
dialogs?
 
hi
using your method, you can select the file and click the open button. but if
that is too much of a hassel, then you would need to hard code the open file
into your code ie
Workbooks.Open Filename:="C:\your\file\path\thafile.xls"

regards
FSt1
 
Use the following in which myFileOpen is True if a valid file was selected
and opened, else False.

Dim myFileOpen as Boolean
myFileOpen = Application.Dialogs(xlDialogOpen).Show
 

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

Back
Top