Jump to content

Recommended Posts

Posted

I would like to know if there is a trick to using the run function? I would like my script to start the excel macro but NOT wait for any information back. It should end right there.

#include <Excel.au3>

Global $oExcel, $oWkbook, $title, $sFrm
Global $sXLS = "Microsoft Excel"
Global $sFrm = "I:\Engineering\Admin\Timecards\Scripts\frmDateDivision.frm"
Global $sBAS1 = "I:\Engineering\Admin\Timecards\Scripts\CreateChecklist.bas"
Global $sBAS2 = "I:\Engineering\Admin\Timecards\Scripts\RunForm.bas", $sMacroName = "Start"
Global $sBAS3 = "I:\Engineering\Admin\Timecards\Scripts\Buttons.bas"
Global $sBAS4 = "I:\Engineering\Admin\Timecards\Scripts\FDFImport.bas"

WinMinimizeAll()

LoadMacros()


Func LoadMacros()

    $oWkbook = "I:\Engineering\Admin\Timecards\EPPIResourceExport.xls"

    $oExcel = ObjGet("", "Excel.Application")

    If ProcessExists("excel.exe") Then
        $oExcel.Workbooks.Open($oWkbook)
    Else
        $oExcel = _ExcelBookOpen($oWkbook)
    EndIf

    ProcessWait("excel.exe")

    $oExcel.VBE.ActiveVBProject.VBComponents.Import($sFrm)
    $oExcel.VBE.ActiveVBProject.VBComponents.Import($sBAS1)
    $oExcel.VBE.ActiveVBProject.VBComponents.Import($sBAS2)
    $oExcel.VBE.ActiveVBProject.VBComponents.Import($sBAS3)
    $oExcel.VBE.ActiveVBProject.VBComponents.Import($sBAS4)
    $oExcel.run($sMacroName) ;run the macro

EndFunc

I want AutoIt to end here, not when the Excel macro is done running.

Thanks,

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
  • Recently Browsing   0 members

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