The below code returns Run Time Error 97 – Can not call friend on object which is not an instance of defining class.
Option Compare Database
Public Static Sub QBCostCodeTest()
Dim QBC As QBConnection
Dim QBItem As qcItem
Dim strString As String
Set QBC = QBConnection
‘, “\\ramqb01\e$\RAM\EVG testing\Evergreene Companies Test.qbw”
QBC.Connect “”, “MyAppName”, qbOpenModeDontCare, “”, “Q:\RAM\EVG Testing\MyQuickBooksDatabaseName.qbw”
Set QBItem = QBC.Company.Items(100)
Items.Rename QBItem, “1118 Eng – Driveways”
Make sure you commit the item after renaming it. Here is an example:
Dim oI As qcItem
QBConnection.Connect “”, APP_NAME, qbOpenModeDontCare, ACCESS_CODE
Set oI = Items.GetByFullName(“Framing”)
Items.Rename oI, “Framing New Name”
I should have mentioned that:
1. The error occurs on the line: Items.Rename QBItem, “1118 Eng – Driveways”, so Items.Commit will not even run.
2. This exact same code works for renaming Venders and Customers, but errors on Items.
What version of the library do you have? You can download the latest from http://download.synergration.com/coreobjx70.zip
Make sure you register them using REGSVR32.EXE
Same problem. No solution found.
You must be logged in to reply to this topic.