System.Runtime.InteropServices.COMException was caught
Message=An internal QuickBooks error occurred while trying to access the QuickBooks company data file.
at QBFC12Lib.IQBSessionManager.BeginSession(String qbFile, ENOpenMode openMode)
at MonsoonToQuickbooks.Import.UpdateQBInventoryItem(String ListID, String Quantity) in ...
If you get this error sporadically it is generally an RPC failure and not an issue with your code. You can solve it by lumping multiple transactions together when submitting them to QuickBooks or require the client to be open in order to process the requests (don't specify a file when calling .BeginSession).
Make sure the compile option is set to x86...not x64 or "Any Platform".
HRESULT = 462 (1CE)
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
...another alternative, if you are testing, is to open the QuickBooks UI...set .BeginSession(My.Settings.QuickBooksFile, QBFC12Lib.ENOpenMode.omDontCare)...omDontCare so that you can support multi-user mode...this will force QuickBooks to stay in memory...you may just need to Authorize the app to access QuickBooks.