Jump to content

Quickbooks change account


Docfxit
 Share

Go to solution Solved by Nine,

Recommended Posts

I have this script that runs fine interactively.  I can't get it to run compiled.

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Opt("TrayIconDebug", 1) ;0-off
; Set so that tray displays current line number
WinWait("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","General Ledger Last ")
If Not WinActive("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","General Ledger Last ") Then WinActivate("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","General Ledger Last ")
WinWaitActive("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","General Ledger Last ")
Send("{ENTER}")
WinWait("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","Enter Credit Card Ch")
If Not WinActive("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","Enter Credit Card Ch") Then WinActivate("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","Enter Credit Card Ch")
WinWaitActive("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","Enter Credit Card Ch")
Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}")
Sleep(100)
Send("Loan")
; Loan payable officer
Sleep(500)
Send("{ENTER}")
;Sleep(500000)
Send("{ALTDOWN}a{ALTUP}")
Sleep(100)
WinWait("Recording Transaction","Cancel")
If Not WinActive("Recording Transaction","Cancel") Then WinActivate("Recording Transaction","Cancel")
WinWaitActive("Recording Transaction","Cancel")
Send("{ALTDOWN}y{ALTUP}")

Running in Windows 10

AutoIt ver. 3.3.16.1

Edited by Docfxit
Link to comment
Share on other sites

  • Solution

This is what I've previously used to send text to QB --

Const $QBVersion = "QuickBooks Pro 2021"

If WinActivate($QBVersion, "Write Checks - Due Client") Then
        send( "{TAB 3}" )
        send( "Client Reimb:Reimb Owed" )
        send( "{TAB 4}" )
        send( "Checks" )
        sleep(250)
        send( "{ENTER 2}" )
        sleep( 1000 )

        send( "{TAB}" )

        If ControlGetFocus($QBVersion, "Write Checks - Due Client") <> 309 Then
            send( "{TAB}" )
        EndIf

;       If ControlCommand ($QBVersion, "Write Checks - Due Client", 305, "IsChecked") = 0 Then
;           send( "{TAB}" )
;       EndIf
    Else
        Beep()
    EndIf

 

Link to comment
Share on other sites

9 minutes ago, Nine said:

Maybe you are running Scite x64 but you compile x86 ?

I recompiled it to x64 and it solved the problem.  In the past I was running Quickbooks 2020 and x86 worked.  I did switch to 2021 this year and it seems to need x64.  Thank you very much for catching that.  Now I can get something done.

Link to comment
Share on other sites

18 minutes ago, Danp2 said:

This is what I've previously used to send text to QB --

Const $QBVersion = "QuickBooks Pro 2021"

If WinActivate($QBVersion, "Write Checks - Due Client") Then
        send( "{TAB 3}" )
        send( "Client Reimb:Reimb Owed" )
        send( "{TAB 4}" )
        send( "Checks" )
        sleep(250)
        send( "{ENTER 2}" )
        sleep( 1000 )

        send( "{TAB}" )

        If ControlGetFocus($QBVersion, "Write Checks - Due Client") <> 309 Then
            send( "{TAB}" )
        EndIf

;       If ControlCommand ($QBVersion, "Write Checks - Due Client", 305, "IsChecked") = 0 Then
;           send( "{TAB}" )
;       EndIf
    Else
        Beep()
    EndIf

 

I tried changing my code as a test because I like your approach.

Const $QBVersion = "Docfxit, Inc.  - QuickBooks Desktop Pro 2021"
WinWait($QBVersion, "General Ledger Last Year")
If Not WinActive($QBVersion, "General Ledger Last Year") Then WinActivate("Docfxit, Inc.  - QuickBooks Desktop Pro 2021","General Ledger Last Year")
WinWaitActive($QBVersion, "General Ledger Last Year")

I couldn't get it to work.

Link to comment
Share on other sites

I think it is looking better now.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Opt("TrayIconDebug", 1) ;0-off
; Set so that tray displays current line number
Const $QBVersion = "Docfxit, Inc.  - QuickBooks Desktop Pro 2021"
If WinActivate($QBVersion, "General Ledger Last Year") Then
    Send("{ENTER}")
    Sleep(100)
;   MsgBox(0, "", "Pressed Enter: " ) ; Shows
    If WinActivate($QBVersion, "Enter Credit Card Ch") Then
        send( "{TAB 8}" )
        Sleep(100)
        Send("Loan")
        ; Loan payable officer
        Sleep(500)
        Send("{ENTER}")
        Send("{ALTDOWN}a{ALTUP}")
        Sleep(100)
    EndIf
    If WinActivate("Recording Transaction","Cancel") Then
        Send("{ALTDOWN}y{ALTUP}")
        Sleep(200)
        Send("{UP}")
    EndIf
Else
    Beep()
EndIf

I can't get the Sleep(200) before the Send("{up}") correct.

Link to comment
Share on other sites

Yea!!!

This is working:

If WinActivate("Recording Transaction", "Cancel") Then
        Send("!y")
    EndIf
    While WinExists("Recording Transaction", "Cancel")
        Sleep(100)
    WEnd
    If WinActivate($QBVersion, "General Ledger Last Year") Then
        Send("{UP}")
    EndIf

 

You guys are great.

It's so nice getting your help to resolve issues.

Thanks a bunch...

Edited by Docfxit
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...