J
jonneke
I am trying to make a link in Acces to an Excel file.
This excel file contains several sheet with different names.
My form in Access has a field that corresponds to the name of the
excel sheets (Formname in script).
When the name in the form contains points or spaces my link to the
sheet with the same name does not work.
I tried to put brackets [] on either side of the name, but then
linking does not work at all.
Please let me know if you have any suggestions.
Code (works when Formname.Value does not contain spaces or points
etc):
Private Sub CommandActionRegister3_Click()
Dim Location
Location = Me.Formname.Value & "!A1"
Application.FollowHyperlink "file name", Location, True
End Sub
This excel file contains several sheet with different names.
My form in Access has a field that corresponds to the name of the
excel sheets (Formname in script).
When the name in the form contains points or spaces my link to the
sheet with the same name does not work.
I tried to put brackets [] on either side of the name, but then
linking does not work at all.
Please let me know if you have any suggestions.
Code (works when Formname.Value does not contain spaces or points
etc):
Private Sub CommandActionRegister3_Click()
Dim Location
Location = Me.Formname.Value & "!A1"
Application.FollowHyperlink "file name", Location, True
End Sub