Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding functional currencies to GETRATES.AVB 1

Status
Not open for further replies.

mehrcpa

Technical User
Aug 3, 2012
3
US
Would a kind soul please help me add additional functional currencies to the GETRATES.AVB Sage Accpac ERP Macro?

The out of the box macro appears to only update USD and CAD functional currencies. I added the additional currencies to the macro like this:
curTables(0) = "CAD"
curTables(1) = "USD"
curTables(2) = "GBP"
curTables(3) = "EUR"
curTables(4) = "ZAR"
curTables(5) = "NZD"

The 0 and 1 values already exist in the out of the box version, I added 2 through 5.

The macro runs, but it generates a subscript error and the newly added currencies do not show up as columns on the resulting Excel spreadsheet.

Thanks in advance to the awesome Accpac experts out there that are always willing to help!

Regards,
Michael
 
Thanks guys, I changed Dim curTables(1) to Dim curTables(6) per your suggestion. Why 6?

I now get a different error:
Run-time error '438':
Object doesn't support this property or method

It looks like it hangs when it is trying to update Thai currency.
 
Because there are 6 elements in the array.

Check the session.errors object, or, try to add Thai manually, you'll see the error.
 
It should be Dim curTables(5) not Dim curTables(6) or alternatively you could use Dim curTables(1 to 6)

When setting an array in VB using the first example, you're setting it with an implied lower bound of 0 so you would use the following:
curTables(0) = "CAD"
curTables(1) = "USD"
curTables(2) = "GBP"
curTables(3) = "EUR"
curTables(4) = "ZAR"
curTables(5) = "NZD"

Using the second example you're setting an explicit lower bound of 1 so your code for setting values would be as follows:
curTables(1) = "CAD"
curTables(2) = "USD"
curTables(3) = "GBP"
curTables(4) = "EUR"
curTables(5) = "ZAR"
curTables(6) = "NZD"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top