To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=106745 Issue #|106745 Summary|OFFICE 2007 when Dynamically Creating Hyperlink (SubAd |dress can not be dynamically created) Component|Spreadsheet Version|1.0.0 Platform|All URL|http://social.msdn.microsoft.com/Forums/en-US/isvvba/t |hread/563c1290-d312-41d4-8525-aa181e822ded?prof=requir |ed OS/Version|Windows Vista Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P3 Subcomponent|code Assigned to|spreadsheet Reported by|danlkb1
------- Additional comments from danl...@openoffice.org Mon Nov 9 18:52:25 +0000 2009 ------- There is a bug when dynamically creating a "SubAddress" within a Hyperlink within an Excel 2007 Macro. The commented out line within the Macro below created in Excel 2007 will fail to create a valid hyperlink: The workaround is contained in the 2 lines following the commented out line. The SubAddress is hardcoded, then modified (see macro below). -- the referenced URL above comes from another person with the same issue in Word -- "Alexandra1011" came up with the same workaround that I used. -- The following is a macro created in Excel2007 (OS: Vista). Sub CreateHyperLink() ' CreateHyperLink Macro Dim strRange As String Dim strSubAddr As String Dim strTextToDisp As String Dim num As Integer Dim lineNumber As String Sheets("MIPR Tracking").Select ' Add a hyperlink to 150 cells on an excel spreadsheet (each hyperlink will reference a different worksheet) ' The spreadsheet has 150 different sheets named "MIRP 1" thru "MIPR 150" For num = 1 To 150 ' The First Hyperlink will be added to the "A4" Cell of a sheet called "MIPR Tracking"... Subsequent Hyperlinks added to Cells "A5", "A6", etc. lineNumber = num + 3 ' Select the Cell that the hyperlink is to be added to. strRange = "A" & lineNumber Range(strRange).Select strSubAddr = "'MIPR " & num & "'!A1" strTextToDisp = "MIPR " & num 'The following dynamic "SubAddress:=strSubAddr" causes the link not to work -- The following 2 lines allow for a workaround (hardcoded "SubAddress" that is then modified) 'ActiveSheet.Hyperlinks.Add Anchor:=Selection.Range, Address:="", SubAddress:=strSubAddr, TextToDisplay:=strTextToDisp ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="'MIPR 3'!A1", TextToDisplay:=strTextToDisp Selection.Hyperlinks(1).SubAddress = strSubAddr Next End Sub --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@sc.openoffice.org For additional commands, e-mail: issues-h...@sc.openoffice.org --------------------------------------------------------------------- To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org