I'm coding from within Excel for Office 365 32Bit VBA Application Edition 7.1 and using in a W10 laptop
I'm referencing AutoCAD 2018 Type Library and trying to use the SetBlockTableRecordId method to insert a block into a Table cell with the following codeline:
myTable.SetBlockTableRecordId j + 1, 0, myDoc.Blocks("blockName").ObjectID, True
However I'm getting a compiling error with "Compiler error: not corresponding type" as the (hoepfully) closest translation
The very same statement doesn't error out if I code in AutoCAD 2018 VBA 7.1 environment
I know (or, at least, I think) this has to do with the 32/64 bit thing, and blindly tried ObjectID32 property but to no avail
Is anybody aware of a solution?
thank you
Just a quick shoot in the dark.
Have you tried this:
myTable.SetBlockTableRecordId j + 1, 0, CLngPtr(myDoc.Blocks("blockName").ObjectID), True
Norman Yuan
thanks Norman for your reply
Yes, it was the first attempt but didn't work and still facing same compile error
it may be of interest that:
- without "CLngPtr", the compile error would highlight the ".ObjectID" part of the statement
- with the "CLngPtr" the compile error would highlight ".CLngPtr" part
I'm thinking that my Excel 32 bit would never handle a call to a method (SetBlockTableRecordId) that is requiring some 64 bit argument