GeoA Posted February 4, 2009 Share Posted February 4, 2009 (edited) # Original post Hey, Can anybody help me use Autoit to add a hyperlink in Excel. Here's the macro from Excel: Range("B1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _ "C:\Documents and Settings\username\Desktop\folder\2_3_2009_10_14_37\0.png" _ , TextToDisplay:= _ "0.png" But I don't know have to convert that to Autoit code. Thanks, G # end original post So, I'm trying to use _ExcelHyperLinkInsert but it fails. The console show me this message: C:\Program Files\AutoIt3\Include\Excel.au3 (611) : ==> The requested action with this object has failed.: $oExcel.ActiveSheet.Hyperlinks.Add($oExcel.Selection, $sAddress, "", $sScreenTip, $sLinkText) $oExcel.ActiveSheet.Hyperlinks.Add($oExcel.Selection^ ERROR Any ideas why? Edited February 4, 2009 by GeoA Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 4, 2009 Share Posted February 4, 2009 Hey,Can anybody help me use Autoit to add a hyperlink in Excel. Here's the macro from Excel: Range("B1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _ "C:\Documents and Settings\username\Desktop\folder\2_3_2009_10_14_37\0.png" _ , TextToDisplay:= _ "0.png"But I don't know have to convert that to Autoit code.Thanks,GLook at _ExcelHyperlinkInsert() in the help file. 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...
GeoA Posted February 4, 2009 Author Share Posted February 4, 2009 Duh! All I had to do was get the latest Autoit. It seems Autoit just keeps getting better at making it easier to automate EVERYTHING! Thanks! Link to comment Share on other sites More sharing options...
GeoA Posted February 4, 2009 Author Share Posted February 4, 2009 (edited) TTT So, I'm trying to use _ExcelHyperLinkInsert but it fails. The console show me this message: C:\Program Files\AutoIt3\Include\Excel.au3 (611) : ==> The requested action with this object has failed.: $oExcel.ActiveSheet.Hyperlinks.Add($oExcel.Selection, $sAddress, "", $sScreenTip, $sLinkText) $oExcel.ActiveSheet.Hyperlinks.Add($oExcel.Selection^ ERROR Any ideas why? Edited February 4, 2009 by GeoA Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 4, 2009 Share Posted February 4, 2009 TTTSo, I'm trying to use _ExcelHyperLinkInsert but it fails. The console show me this message:C:\Program Files\AutoIt3\Include\Excel.au3 (611) : ==> The requested action with this object has failed.:$oExcel.ActiveSheet.Hyperlinks.Add($oExcel.Selection, $sAddress, "", $sScreenTip, $sLinkText)$oExcel.ActiveSheet.Hyperlinks.Add($oExcel.Selection^ ERRORAny ideas why?Can't tell without seeing your usage. Post a demo that recreates the symptom (as short as possible, please). 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...
GeoA Posted February 5, 2009 Author Share Posted February 5, 2009 Sorry, it works now. I was just opening Excel with "$oExcel = ObjGet($FILE)" then trying to use the UDF for adding the hyper link. Now that I using UDF for everything thing I need to do with Excel, everything works fine. Seems like I try to hard to prove how dumb I am! Thanks for the help, G 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