Sign in to follow this  
Followers 0
martmeister

Running Script to Call Excel Macro.. Error?

4 posts in this topic

Hey guys can you help me with this script..

Here is a part of the code:

#include <Excel.au3>

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

Send("C:\Documents and Settings\HopperVS2.xlsm")

$oExcel.Run("FileHOP7")

When the script get to running the macro it errors out with:

$oExcel.Run("FileHOP7")

$oExcel^ERROR

error: expected a "=" operator in assignment statement

.....Where is wanting me to put the = because i have never had this problem??

Thanks everyone for input!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You are using Send() wrong. Send() is for sending Keystrokes. What are you trying to do?

Edited by bchris01

Share this post


Link to post
Share on other sites

Hey guys can you help me with this script..

Here is a part of the code:

#include <Excel.au3>

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

Send("C:\Documents and Settings\HopperVS2.xlsm")

$oExcel.Run("FileHOP7")

When the script get to running the macro it errors out with:

$oExcel.Run("FileHOP7")

$oExcel^ERROR

error: expected a "=" operator in assignment statement

.....Where is wanting me to put the = because i have never had this problem??

Thanks everyone for input!

Try this

Global $bBook = "C:\Documents and Settings\HopperVS2.xls" ; I assume this is the book you want to open

$oExcel = _ExcelBookOpen($bBook)

WinWait("Microsoft Excel - HopperVS2.xls")

$oExcel.Run("FileHOP7") ; I assume this is the macro you want to run

REB


MEASURE TWICE - CUT ONCE

Share this post


Link to post
Share on other sites

You are using Send() wrong. Send() is for sending Keystrokes. What are you trying to do?

I was using a partial amount of code and didn't include the others lines

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