0
  1. I am using C# in VS 2010
  2. I am using Quickbooks 2011 Premium
  3. I downloaded the latest QBSDK (v12.0)
  4. I open the QB sample data file (sample_product-based business.qbw)
  5. I open the InvoiceAdd project (C:\Program Files (x86)\Intuit\IDN\QBSDK12.0\samples\qbdt\c-sharp\QBFC\QBInvoiceAdd) - I converted their project to VS 2010 and then I set the build option to x86
  6. At the line:

    sessionManager.BeginSession("", ENOpenMode.omDontCare); 
    

    I get the error

    Can't open quickbooks: Quickbooks can't start because it is already running

I have tried entering a full path into the beginsession function call but I get no further.

Please help me find what I am doing wrong. Am I using the wrong SDK for a desktop app?

Thanks!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

1

Am I missing something? The error message is "Quickbooks can't start because it is already running". So the problem is not with the path - according to this message.

Exit Quickbooks and possibly reboot the computer.

Ok. Sorry to state the obvious! This page suggests that this was an error in QB 2011 that was fixed in 2012. A little digging may uncover a fix for QB 2011 Premium.

Alternatively, it might be UAC control. Temporarily reduce the level of UAC to nothing to discover if this is the cause.

Added: The third option is to disable Quickbooks Instant Start in QBs Preferences, which keeps QB running as a background process. Reboot the computer after this change.

Andy G
  • 19,232
  • 5
  • 47
  • 69
  • Tried that... thanks... but nothing doing. I think the problem may be due to something in permissions. But there seems to be no way to add my app to QB permissible apps. – An Old Guy and His Dog Jun 17 '13 at 19:51
  • OK... tried the 2nd option... cannot seem to find a solution for 2011 short of upgrading to 2012. :-( – An Old Guy and His Dog Jun 17 '13 at 21:06
  • Tried the third option. Setting UAC to nothing proved fruitless. Damn... I liked that one! – An Old Guy and His Dog Jun 17 '13 at 21:06
  • trying the instant start now. – An Old Guy and His Dog Jun 17 '13 at 21:07
  • Don't forget to reboot, otherwise you will need to go into the Services and stop all currently running QB items. – Andy G Jun 17 '13 at 21:09
  • OK... stoopid question... where is Quickbooks Instant Start in the preferences? Cannot seem to find it. – An Old Guy and His Dog Jun 17 '13 at 21:11
  • Apparently: "From the Edit menu, select Preferences. Select General icon and on the My Preferences tab. Clear the Keep QuickBooks running for quick startups checkbox and click Ok." – Andy G Jun 17 '13 at 21:14
  • OK... did that... and the error has changed to a fascinating one: the application trying to connect to quickbooks does not support quickbooks premier. Am I using the right API? – An Old Guy and His Dog Jun 17 '13 at 21:29
  • Sorry, I'm unable to help further. Maybe [this link](http://stackoverflow.com/questions/7083744/what-is-the-best-way-to-integrate-with-quickbooks-from-c-sharp-code) is worth reading. Good luck. Perhaps someone else will contribute. – Andy G Jun 17 '13 at 21:50
  • Turns out, Andrew, that I think you solved the problem. The last error I received was due to a small piece of code I added to fix this early on that forced the authorization. But it did not allow premier. Once I removed the line of code it worked. – An Old Guy and His Dog Jun 20 '13 at 16:15