Excel Add-In for MYOB

Build 24.0.9060

Connecting from VBA

Before You Connect

Prior to connecting from VBA, it is necessary to add a reference to the add-in. This should be done once per module.

From the Microsoft Visual Basic for Applications window ("Visual Basic" on the Developer ribbon), navigate to Tools -> References. Check the box next to CData Excel Add-In and confirm with OK.

Establishing a Connection

To execute SQL to MYOB, initialize an ExcelComModule instance. This class can be used with any CData provider. You can call the following methods to initialize the module for working with MYOB:

  • SetProviderName
  • SetConnectionString

You can use the following code to start Querying Data.

Dim module As New ExcelComModule
module.SetProviderName ("MYOB")
module.SetConnectionString(" If using an online instance: OAuthClientId=YourClientId;OAuthClientSecret=YourClientSecret;CompanyFileId=yourCompanyFileId;CallbackURL=http://localhost:33333;User=companyFileUser;Password=companyFilePassword; If using an on premise instance: InitiateOAuth=OFF;URL=http://localhost:8080/accountright;CompanyFileId=327eed10-9615-4e5e-bd9e-ae2cc00e2c70;User=companyFileUser;Password=companyFilePassword;")

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060