Hello all,
Here is a question i have for an issue I'm dealing with. I have a macro that fills in text boxes in a word document. I just found out that for some reason, I have several people who have had issues get the program to open up the file. Several items its just that someone has moved the file to a different location and for a few i found out that they have different drive lettering for the shared drive. My thought solution was that when the macro tries to open the file. If there is an error than there should be a windows explorer window pop open and have the user navigate to the file and then open said file they need. How would i go about doing that and have the file location/name be recorded to a variable. The code below is what I'm currently doing. I just need that code to add in to make this work.
Here is a question i have for an issue I'm dealing with. I have a macro that fills in text boxes in a word document. I just found out that for some reason, I have several people who have had issues get the program to open up the file. Several items its just that someone has moved the file to a different location and for a few i found out that they have different drive lettering for the shared drive. My thought solution was that when the macro tries to open the file. If there is an error than there should be a windows explorer window pop open and have the user navigate to the file and then open said file they need. How would i go about doing that and have the file location/name be recorded to a variable. The code below is what I'm currently doing. I just need that code to add in to make this work.
VBA Code:
wfile = "G:\Agreements\Improvement.Agr-2Party.docx"
If Dir(wfile) <> "" Then
Wordapp.Documents.Open (wfile)
Wordapp.Visible = True
Else
MsgBox "Link to file is missing, please use explorer window to select the Improvement.Agr-2Party document "
'wfile = 'Here is where the window explorer code will go'
Wordapp.Documents.Open (wfile)
Wordapp.Visible = True
End If