M
matfiej
Hello!
1. When I execute code:
Code
-------------------
Workbooks(1).Worksheets(i).Shapes.Item(s).Hyperlink.SubAddress = "'" & sSheetName &"'!A1
-------------------
where 's' is a number of shape (rectangle) in which I want to change o
add a hyperlink
'i' is a number of a worksheet
sSheetName is a string variable with target sheet
I get a run-time error 1004: Application-defined or object-define
error
2.What is more, I managed to execute properly this code once (don'
know how). It is executed for different shapes in different worksheet
(using a loop) and the link is changing to point the previous and th
next sheet from the sheet that is being linked. (like arrows <- an
->)
As a result hyperlinks in all shapes linking to the last sheet (-
shapes) or to the third one (<-).
It is worth mentioning that when I was debuging macro all variable
were good.
It seems to me that when sSheetName variable is changing hyperlink
that has been pasted before are also changing (and shouldn't)
Could you tell me why and how to solve it?
Mateus
1. When I execute code:
Code
-------------------
Workbooks(1).Worksheets(i).Shapes.Item(s).Hyperlink.SubAddress = "'" & sSheetName &"'!A1
-------------------
where 's' is a number of shape (rectangle) in which I want to change o
add a hyperlink
'i' is a number of a worksheet
sSheetName is a string variable with target sheet
I get a run-time error 1004: Application-defined or object-define
error
2.What is more, I managed to execute properly this code once (don'
know how). It is executed for different shapes in different worksheet
(using a loop) and the link is changing to point the previous and th
next sheet from the sheet that is being linked. (like arrows <- an
->)
As a result hyperlinks in all shapes linking to the last sheet (-
shapes) or to the third one (<-).
It is worth mentioning that when I was debuging macro all variable
were good.
It seems to me that when sSheetName variable is changing hyperlink
that has been pasted before are also changing (and shouldn't)
Could you tell me why and how to solve it?
Mateus