Jump to content

Running Script to Call Excel Macro.. Error?


Recommended Posts

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!

Link to comment
Share on other sites

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

Edited by bchris01
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...