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
Jezebel - 15 Feb 2006 10:52 GMT
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.
> Hi
>
[quoted text clipped - 15 lines]
>
> Martin
Jonathan West - 15 Feb 2006 11:35 GMT
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.

Signature
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
> Hi
>
[quoted text clipped - 15 lines]
>
> Martin