bubke Posted December 1, 2010 Share Posted December 1, 2010 Hi, Is there someone who could help me with converting Excel text cells in cells with hyperlinks? I've many hyperlinks in Excel in a column, but they are in text format. What I want is that the links are clickable, so that they open in a browser. I don't have many experience with Office in combination with autoit. Maybe there is someone who has an example script. Any help is very welcome! Thank you Link to comment Share on other sites More sharing options...
water Posted December 1, 2010 Share Posted December 1, 2010 Please hava a look at the Excel UDF function _ExcelHyperlinkInsert: Inserts a hyperlink into the active page. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
JoHanatCent Posted December 1, 2010 Share Posted December 1, 2010 (edited) Maybe there is someone who has an example script. Any help is very welcome! This is just that. An Example. Please test before using it. #include <Excel.au3> $Count = 0 $oExcel = _ExcelBookOpen(@DesktopDir & "\Book.xls", 0);0 = file not visible $Count = $oExcel.Worksheets(1).Usedrange.Rows.Count For $i = 1 To $Count $sCellValue = _ExcelReadCell($oExcel, $i, 2);row = $i number, col = 2 (B) _ExcelHyperlinkInsert($oExcel, $sCellValue, $sCellValue, $sCellValue, $i, 2) ;Correct use: ;_ExcelHyperlinkInsert($oExcel, $sLinkText, $sAddress, $sScreenTip, $sRangeOrRow [, $iColumn = 1]) Next _ExcelBookClose($oExcel) $oExcel = _ExcelBookOpen(@DesktopDir & "\Book.xls", 1);1 = file is visible Edited December 1, 2010 by JoHanatCent Link to comment Share on other sites More sharing options...
bubke Posted December 3, 2010 Author Share Posted December 3, 2010 This is just that. An Example. Please test before using it. #include <Excel.au3> $Count = 0 $oExcel = _ExcelBookOpen(@DesktopDir & "\Book.xls", 0);0 = file not visible $Count = $oExcel.Worksheets(1).Usedrange.Rows.Count For $i = 1 To $Count $sCellValue = _ExcelReadCell($oExcel, $i, 2);row = $i number, col = 2 (B) _ExcelHyperlinkInsert($oExcel, $sCellValue, $sCellValue, $sCellValue, $i, 2) ;Correct use: ;_ExcelHyperlinkInsert($oExcel, $sLinkText, $sAddress, $sScreenTip, $sRangeOrRow [, $iColumn = 1]) Next _ExcelBookClose($oExcel) $oExcel = _ExcelBookOpen(@DesktopDir & "\Book.xls", 1);1 = file is visible Thank you for your help, you set me on the right path! Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 3, 2010 Share Posted December 3, 2010 For a particular Excel hyperlink, you can set the property directly: $oExcel.ActiveSheet.Hyperlinks(1).TextToDisplay = "Link text here" Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now