assigning hyperlink

J

Jack

Hi,
I have a value that user chose in cmbweek.
With this value, I would like to assign a hyperlink value to an external
file so when user clicks the command button(cmdfinweek), an excel file will
open. Code is below. last line is giving an error. What am I doing wrong? any
suggestions?

Dim dirct As String
dirct = "C:\temp\" & cmbweek.Value
Me.cmdfinweek.Hyperlink dirct
 
O

Ofer

Try this

Dim dirct As String
dirct = "C:\temp\" & cmbweek.Value
Application.FollowHyperlink dirct

' will open any file type defined in widows by the extention
 
Top