Jump to content
Sign in to follow this  

Excel Macro Question

Recommended Posts


Here is my code:

#include <Excel.au3>

run ("C:\Program Files\Microsoft Office\Office12\EXCEL.exe") ;opens excel

winwaitactive ("Microsoft Excel - Book1")

sleep (900)

Global $oExcel = _ExcelBookOpen("C:\Documents and Settings\programHopper.xlsm")

WinWait("Microsoft Excel - programHopper.xlsm")



The Last Line Is Where Im Getting My Error..ehh, I dont know why its not running the macro called MacroHop

The Macro is Part of the the program Hopper and works correctly when I manually run it so i know it works. I just need some help automating this. lol


Share this post

Link to post
Share on other sites

Try this :

$filename = "C:\Documents and Settings\programHopper.xlsm"
$oExcel = ObjCreate("Excel.Application") ;crete excel object
$oExcel.WorkBooks.Open($FileName) ;open desired file containing the macro
$oExcel.Run("MacroHop") ;run the macro

it 100% works i always use it =)

Share this post

Link to post
Share on other sites

Try this one:


It works for me. Maybe you need to check the Macro permissions and security settings.

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.