Sign in to follow this  
Followers 0
GeoA

Help with Excel AGAIN!

6 posts in this topic

#1 ·  Posted (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 by GeoA

Share this post


Link to post
Share on other sites



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

Look 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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by GeoA

Share this post


Link to post
Share on other sites

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?

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0