Jump to content
Sign in to follow this  
GeoA

Help with Excel AGAIN!

Recommended Posts

GeoA

# 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
PsaltyDS

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
GeoA

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
GeoA

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
PsaltyDS

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
GeoA

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.