Open Dialog

M

Mouckster

I need some code that will open a dialog box and then pass the string
through as a variable. I've had a hard time finding much along the
lines of being able to open things in PPT.

It seems easy enough if you want to open a pre defined file, but if you
want to be able to use a macro to browse for a file, this becomes much
harder.

Any help would be creatly appreciated.

Cheers.

Dan.
 
G

Gas

Mouckster skrev:
I need some code that will open a dialog box and then pass the string
through as a variable. I've had a hard time finding much along the
lines of being able to open things in PPT.

It seems easy enough if you want to open a pre defined file, but if you
want to be able to use a macro to browse for a file, this becomes much
harder.

Any help would be creatly appreciated.

Cheers.

Dan.

Hi Dan,

Try this:
Dim lngName As Long

With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
lngName = .SelectedItems.Count
p = .SelectedItems(lngName)
End With

p will returne your string.

Gas
 
M

Mouckster

Thanks for you help.

Got some tweaking to do to make it work with my file, but I think that
this will get me on my way. Thanks.

BTW - Have you ever heard of having ppt extract table data from an
Access or even Excel file?

Cheers.

Dan.
 
Top