View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
FrigidDigit[_2_] FrigidDigit[_2_] is offline
external usenet poster
 
Posts: 32
Default Help with creating hyperlink via VBA

Hi All,

I'm trying to create a hyperlink for each entry in a list of filenames.
Below is the code that I have come up with so far (I know very little about
VBA:))
fname = objFolder.Path & "\" & objFile.Name
Addrs = Workbooks("Subcontractor invoices Overview.xls").Worksheets("Invoice
Listing").Cells(eRow, 8).Address
MyFormula = "=Hyperlink(" & fname & ")"
Workbooks("Subcontractor invoices Overview.xls").Worksheets("Invoice
Listing").Range(Addrs).Value = MyFormula

When I try to run this it gives me a runtime error 1004 Application defined
or object defined error on the last line above.

Any help would be much appreciated.

FD