common dialog control in word VBA

M

Martin

Hi

I have written a macro that pulls data in from an excel sheet and puts
it in a word doc.

I want to allow the user to select which excel file they want to use by
ideally using the common dialog control to allow them to navigate to the
file they want.

Is there any way of doing this, particularly without using a form to
trigger the dialog control.
I have had a look round the net and it seems a WinAPI call(s) are required.

Any help would be appreciated.

Thanks

Martin
 
J

Jezebel

You don't have to display the form to use the commondialog on it. Put a
commondialog on a userform and you can use code like

With new frmMyForm
With .CommonDialog1
:
.Show
End with
End with


Users see only the dialog, not the form.
 
J

Jonathan West

Hi Martin,

You don't need to use the common dialog at all for this. If you are using
office XP or later, you can use the Application.FileDialog object to display
a dialog allowing the user to pick a file.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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

Top