Open dialog box.

  • Thread starter Thread starter shmoussa
  • Start date Start date
Put *all* of the code in a standard module of its own named something like
basFileOpen. Then the code behind your button will look something like:

Me.YourFileNameControl = GetOpenFile(CurrentProject.Path, "Select Some File")
 
If Office XP or later:
Set a reference to Office XX object library and go

Dim f As FileDialog

note: look at the filter property of the FileDialog obect

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 
Okay I created a new module and pasted all of the code, from the CODE
START to CODE FINISH (without including those specific lines
themselves) and named it basOpenFile. I created a new button, and used
the code from above so that the button's code looks like this:

Private Sub Command231_Click()

Me.basOpenFile = GetOpenFile(CurrentProject.Path, "Select Some File")

End Sub

When I clikc the command button, it highlights ".basOpenFile =" and
says method or data member not found.

I also tried what you said Daniel, however also generated an error.
I'm not sure exactly where and where to paste what you gave me, and
what I am supposed to replace.

I'd appreciate it if you can help me figure this out.
 
I need to also filter the options to only display .csv and .xls files.

When the used clicks the import data command button, they will the
file and click okay. I want the csv file to be imported using an
Import Specification called "Disks." How can this be done?
 
Let's get it working first. This line:
Me.basOpenFile
needs to point to a control on your form or a Dimed variable. ie:

Me.YourTextBoxControlName =
 
You may wish to start a new thread on this last question so others will join
in.
 
Back
Top