Perhaps the most requested automation for Spire is the ability to add sales orders to the system. The Spire API makes this very easy. Only the bare minimum of information is required to add an order. For any information not provided, the Spire API adds the correct data automatically as if you were typing the order into Spire manually.
This demonstration and sample Excel spreadsheet covers the basics of how to make this work. But this time, I include the XLSM file rather than code snippets so you can see it in action with little fuss.
It is suggested that you use Inspire demo data, as the part numbers and customer numbers already exist.
The OrderDetails worksheet contains the orders to import:
The CompanyInfo worksheet contains the settings for the Spire company:
Edit the CompanyInfo sheet to reflect your Spire server, database and user settings.
There is a macro called “ImportOrders” linked to the Ctrl-Shift-I shortcut. After running the macro, you should see:
The last line of each order is updated with the result of the import.
This project contains a component called VBA-JSON by Tim Hall. His copyright and generous licensing information is included in that module.
You can download the Excel file here.