After I activate the hyperlink I get the subscript out of range at the sheet selection line
'Hyperlink aktivieren und Sheet Overview Results
Selection.Hyperlinks(1).Follow NewWindow:=True, AddHistory:=True
Worksheets("Overview Results").Select
AuswerteWb = ActiveWorkbook.Name
'ActiveWindow.Close
The thing is that I have a macro which should use a path of a file as hyperlink and select the sheet "overview Results" from the hyperlinked file.
But I get
Run-time error '9': Subscript out of range
Why use
Hyperlinks.Follow
and notWorkbooks.Open
? If you are opening a new workbook using the hyperlink you will want to do something like this:I highly encourage you to learn about qualifying your statements (for example,
Worksheets("")
is an unqualified statement) since this will cause you many headaches. Similarly, avoidSelection
,Select
,Activate
,ActiveWorkbook
, etc.