Display Word, PDF files within Excel

Joined
Oct 14, 2005
Messages
1
Reaction score
0
By pressing on a checkbox I like to show a list of files (*.doc, *.pdf, *.xls) which are located in a directory which is build up from two Cells (A1 = Number and A2 = Name Client). The user can then choose one of the documents for review purposes (read only).

Since I’m new to VBA I found a code which partly works but it doesn’t go to that directory and it rejects any other docs then *.xls.

This is the code I use:

Sub Docs_Click()

NewFN = Application.GetOpenFilename(FileFilter:="Files (*.xls;*.doc), *.xls;*.doc", Title:="Please select a file")
If NewFN = False Then
'They pressed Cancel
Exit Sub
Else
Workbooks.Open Filename:=NewFN
End If

End Sub
 

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