Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Shouldn't this:
MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave,
what do the """" do? FD "Dave Peterson" wrote in message ... Shouldn't this: MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave you are a genius!!
Thank you so much!! "FrigidDigit" wrote in message ... Dave, what do the """" do? FD "Dave Peterson" wrote in message ... Shouldn't this: MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I take it that it worked!!
Glad you got it going. FrigidDigit wrote: Dave you are a genius!! Thank you so much!! "FrigidDigit" wrote in message ... Dave, what do the """" do? FD "Dave Peterson" wrote in message ... Shouldn't this: MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 ?? ?? -- ?? ?? Dave Peterson ? ? -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worked like a bomb!
Could you explain to me wht """ was used? Thanks again. FD "Dave Peterson" wrote in message ... I take it that it worked!! Glad you got it going. FrigidDigit wrote: Dave you are a genius!! Thank you so much!! "FrigidDigit" wrote in message ... Dave, what do the """" do? FD "Dave Peterson" wrote in message ... Shouldn't this: MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 ?? ?? -- ?? ?? Dave Peterson ? ? -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It puts in a double quote within a string.
You can see this by examining it from the immediate window: fname = "Goofy" ? "=Hyperlink(""" & fname & """)" =Hyperlink("Goofy") -- Regards, Tom Ogilvy "FrigidDigit" wrote in message ... Worked like a bomb! Could you explain to me wht """ was used? Thanks again. FD "Dave Peterson" wrote in message ... I take it that it worked!! Glad you got it going. FrigidDigit wrote: Dave you are a genius!! Thank you so much!! "FrigidDigit" wrote in message ... Dave, what do the """" do? FD "Dave Peterson" wrote in message ... Shouldn't this: MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 ?? ?? -- ?? ?? Dave Peterson ? ? -- Dave Peterson |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom
FD "Tom Ogilvy" wrote in message ... It puts in a double quote within a string. You can see this by examining it from the immediate window: fname = "Goofy" ? "=Hyperlink(""" & fname & """)" =Hyperlink("Goofy") -- Regards, Tom Ogilvy "FrigidDigit" wrote in message ... Worked like a bomb! Could you explain to me wht """ was used? Thanks again. FD "Dave Peterson" wrote in message ... I take it that it worked!! Glad you got it going. FrigidDigit wrote: Dave you are a genius!! Thank you so much!! "FrigidDigit" wrote in message ... Dave, what do the """" do? FD "Dave Peterson" wrote in message ... Shouldn't this: MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 ?? ?? -- ?? ?? Dave Peterson ? ? -- Dave Peterson |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I thought you saw the quote marks when you looked at the formula in the
cell. FrigidDigit wrote: Worked like a bomb! Could you explain to me wht """ was used? Thanks again. FD "Dave Peterson" wrote in message ... I take it that it worked!! Glad you got it going. FrigidDigit wrote: Dave you are a genius!! Thank you so much!! "FrigidDigit" wrote in message ... Dave, what do the """" do? FD "Dave Peterson" wrote in message ... Shouldn't this: MyFormula = "=Hyperlink(" & fname & ")" look more like: MyFormula = "=Hyperlink(""" & fname & """)" or MyFormula = "=Hyperlink(" & chr(34) & fname & Chr(34) & ")" FrigidDigit wrote: 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 ?? ?? -- ?? ?? Dave Peterson ? ? -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a hyperlink | New Users to Excel | |||
Creating a hyperlink in Excel. | Excel Discussion (Misc queries) | |||
Creating a HyperLink | Excel Discussion (Misc queries) | |||
CREATING HYPERLINK IN EXCEL | Excel Discussion (Misc queries) | |||
Creating a formula with a hyperlink | Excel Programming |