assigning hyperlink

G

Guest

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
 
G

Guest

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
 

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