Jump to content
Sign in to follow this  

Excel COM into AutoIt Code

Recommended Posts


Can someone give me an idea of how to turn this Excel Macro into AutoIt usable code? I thought my script below would work, but it doesn't... TIA

ActiveCell.FormulaR1C1 = "www.google.com"
    Selection.Hyperlinks(1).TextToDisplay = "Google"

#include <ExcelCOM_UDF.au3>
$oExcel = _ExcelBookNew()
    $oExcel.ActiveCell.FormulaR1C1 = "www.google.com"
    $oExcel.Selection.Hyperlinks(1).TextToDisplay = "Google"

Share this post

Link to post
Share on other sites


If you want to run an existing macro in an Excel file.

You will need something like this.

; AutoRun Macro

Dim $objXL

$objXL = ObjCreate("Excel.Application")
    With $objXL.Application
        .Visible = True
        ;Open the Workbook
        .Workbooks.Open ("C:\Test.xls")
        $x = .Run("MyMacroName") ; MacroName, Parameters1, Parameter2, ...



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.