QuickBooks Desktop

28 Views Asked by At

I am using QuickBooks SDK to create a paycheck in QuickBooks Desktop. I have the following code.

Sub AddPaycheck2() 
    ' Assuming you have a valid session manager
    Dim SessionManager As QBSessionManager
    ' ... Initialize and start a session (refer to QuickBooks SDK documentation)
    Dim payrollI_Item_Add As IPayrollItemWageAdd ' IPayrollItemWageAdd
    ' Create a request set
    Dim RequestMsgSet As IMsgSetRequest
    Dim ResponseMsgSet As IMsgSetResponse
    
    Set SessionManager = CreateObject("QBFC16.QBSessionManager") 'New QBSessionManager 
    Set RequestMsgSet = SessionManager.CreateMsgSetRequest("US", 13, 0)

    ' Create a payroll item request
    Set payrollI_Item_Add = RequestMsgSet.AppendPayrollItemWageAddRq
    
    SessionManager.OpenConnection "", "xyz"
    SessionManager.BeginSession "", omDontCare

    payrollI_Item_Add.ExpenseAccountRef.FullName.SetValue ""
    payrollI_Item_Add.Name.SetValue "2024-3-18"
    payrollI_Item_Add.WageType.SetValue 1

end Sub
  1. Which QBFC version supports this?
  2. What needs to be done to get to work?
0

There are 0 best solutions below