Programmatically inserting hyperlinks
Thanks for the help Tom
I have figured out that using the Worksheet Hyperlink function from VBA is
not possible according to the online help so I am trying to write VBA code
to accomplish this. I have come up with the mess below, but I get a 438
Error ("Object does not support this property or method")
fname = objFolder.Path & "\" & objFile.Name
Addrs = Workbooks("Subcontractor invoices Overview.xls").Worksheets("Invoice
Listing").Cells(eRow, 8).Address
Workbooks(" Subcontractor invoices Overview.xls").Worksheets("Invoice
Listing").Hyperlink.Add.Range (Addrs), fname
Any chance of pointing out the error?
Thanks
FD
"Tom Ogilvy" wrote in message
...
I would put in the full path if the workbook will be closed. Recording the
code is just a start. It gives you the format for the commands.
--
Regards,
Tom Ogilvy
"FrigidDigit" wrote in message
...
Thanks Tom,
I tried the macro recorder route, but but the resulting code did not show
the full path. Do i only need to specify the filename or should it be
concatenated with the path?
FD
"Tom Ogilvy" wrote in message
...
Turn on the macro recorder (tools=Macro=Record a New Macro) while you
insert a hyperlink manually. Then turn off the macro recorder Then
modify
this recorded code to use the information in your cell and also to
loop
over all the rows you want to process.
Other alternatives include using the Hyperlink worksheet function.
Look
in
Excel Help.
--
Regards,
Tom Ogilvy
"FrigidDigit" wrote in message
...
Hi Everyone
I have a list of files generated via VBA in a sheet. I would like to
automatically generate a hyperlink to each file (The full path is
generated
in the existing code) and place this hlink in the last column for each
file.
Can this easily be done?
Any help will be much appreciated.
FD
|