@shastu wrote:
It seems strange that Autodesk would take away something that works well and is more user friendly.
It's Microsoft's doings, not Autodesk's. VBA macros are a huge source of malicious threats in some other software and industries... we don't see it much in Inventor, but it is a problem for others.
@shastu wrote:
I was hoping more would reply that have actually been through the process of making the change but these two suggestions are helpful and I really appreciate all the links in the second post.
I would venture a guess that much/most of your code will work with iLogic with a few simple tweaks:
- iLogic is based in .NET languages and most commonly VB.net
- Spend a little time searching/reading about the primary differences between VB.net and VBA( VB 6) and it will inform you on what to look for when converting your code.
- I often only need to do these 3 things to convert a VBA script to an iLogic rule:
- Remove "Set" from the code.
- Paste the code into an iLogic rule and then do a search for "Set " <-- with the space
- Replace all instance of "Set " with ""
- Add parenthesis
- Things like Msgbox "Hello World" , become Msgbox("Hello World")
- Add enum names:
- oDoc.SelectionPriority = kComponentSelectionPriority gets changed to:
- oDoc.SelectionPriority = SelectionPriorityEnum.kComponentSelectionPriority
see Page 22 of this PDF for a "Converting VBA to VB.net" guide:
https://ekinssolutions.com/wp-content/uploads/2018/11/CreatingInventorAddIns-AU2018.pdf
@shastu wrote:
Does anyone know if version 2024 will still support VBA or is 2023 the last version that my code will work in?
We've been being warned for years that it's going away, but I'm not convinced that it truly ever will. There are too many businesses that have a lot of their customization in Excel, or other office apps that are written in VBA
But MS has recently made some significant changes that disable macros in Office apps ( recently being this summer).
So now you'll see something like this red Security Risk message, but if you click the Learn More button you will find instructions on how to unblock trusted macros, etc.

Of course that is MS and what they are doing, and does not mean that AD will follow suit or handle things in the same way.
You might search the AutoCAD customization forum for information on this, as I think the AutoCAD community is probably more up to speed on what the future of VBA might look like for AD products than the Inventor community.