Ad Space here

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
Go to last post Go to first unread
Dustin Higgins  
#1 Posted : Monday, September 16, 2019 8:43:13 PM(UTC)
Dustin Higgins

Rank: Advanced Member

Groups: Registered
Joined: 7/1/2018(UTC)
Posts: 63
_United States

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)

I'm putting this out there as a work in progress.  Per some Google searches I don't see a lot of folks trying to automate Quickbooks tasks with PowerShell.  I am a PowerShell freelancer and a small business owner.   With the small business comes some pretty basic accounting.  There are routine expenses every month, mileage reports, and invoices.  In the name of making accounting fun, I'm off to automate a lot of the routine Quickbooks accounting tasks via PowerShell.   Honestly, the real reason is that I want the transactions to be entered the same way with the same comments, etc.  If they are scripted, they will be uniform.  I'm guilty of trying to copy/paste what I did last time.  I don't spend a lot of time in Quickbooks and tend to not have a routine.  There will be frequent updates to this project as I make progress.   So far, I've been able to do the following through the Quickbooks SDK / Com object.

1. Open a connection/session

2. Add a new customer

3. Close the connection/session

The "Add a new customer" code isn't ready to be posted yet.  Here is the code to load the SDK DLL, and Open/Close a Connection/Session:

Code:
Add-Type -path "C:\Program Files (x86)\Common Files\Intuit\QuickBooks\Interop.QBFC13.dll"

Code:

try {     # Create the COM object     $SessionManager = New-Object -ComObject QBFC13.QBSessionManager } catch {     Write-Warning -Message "Could not import ComObject because $($_.Exception.Message)" } # Open the connection $SessionManager.OpenConnection("","DHB PowerShell QB") # Create the Request Message Set $RequestMsgSet = $SessionManager.CreateMsgSetRequest("US", 7, 0) # Create the session $SessionManager.BeginSession("", [Interop.QBFC13.ENOpenMode]::omDontCare) # ... Do stuff here # End the session $SessionManager.EndSession()     # Close the connection $SessionManager.CloseConnection()

Maybe I'm on the wrong track with this thing or there is a better way.  Feel free to comment.

Sponsor
Ad Space here
Spencer  
#2 Posted : Monday, October 14, 2019 10:10:37 AM(UTC)
Spencer

Rank: Newbie

Groups: Registered
Joined: 10/14/2019(UTC)
Posts: 1
_United States
Location: Oklahoma

I've been developing with this https://github.com/jsgoupil/quickbooks-sync which is available as a nuget package. I'm very interested in what you are doing here though because I need a way to connect to QB to automate some things that their SDK does not support. I don't know I can say that this fits my exact need, but I am curious if you go this working or not?

You might check out the github package I linked. I think it will help you in your journey.

Dustin Higgins  
#3 Posted : Monday, October 14, 2019 10:36:58 AM(UTC)
Dustin Higgins

Rank: Advanced Member

Groups: Registered
Joined: 7/1/2018(UTC)
Posts: 63
_United States

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)

I'll definitely check that out.   I got busy over the last month or so and really haven't had time to work on it.  It is definitely something that I want to keep working on in the interest of getting a little time back.  I'll keep posting as I make progess.

Thanks,

Dustin

user45739  
#4 Posted : Tuesday, September 15, 2020 7:44:36 PM(UTC)
user45739

Rank: Newbie

Groups: Registered
Joined: 9/15/2020(UTC)
Posts: 1
_United States

I was searching online and came across this. I had the same issue looking to automate QB and fell short. I ended up using PS to automate the QB GUI. Usually going the GUI route is more fragile but with all of the keyboard shortcuts in QB, it's stable.

It's mostly sending a mouseclick to regain focus and then SendKeys to what you want to do. I've automated my payroll so all I have to do to is do a quick verify, everything is filled in. The script does the checking for holidays, verifies the pay period, puts in the correct days, amounts, etc. Saves a ton of time and now more accurate.

I would go that route.

Dustin Higgins  
#5 Posted : Tuesday, September 15, 2020 9:29:25 PM(UTC)
Dustin Higgins

Rank: Advanced Member

Groups: Registered
Joined: 7/1/2018(UTC)
Posts: 63
_United States

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)

That is pretty neat and I'll keep that in mind.  I got busy with other stuff and never really got back to this.    I have recently experimented with mouse clicks and send keys.  That is cool stuff.  Thanks!

Rss Feed  Atom Feed
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.