Make VBA macro reliable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I have written a macro that fills a title block with information (only text) and it works fine on my PC. The user enters information into a form and then the information is written to the AutoCAD model view by using SendCommand Methods, something like this:
ThisDrawing.SendCommand "loremIpsum" & vbCr ....
ThisDrawing.SendCommand "loremIpsum2" & vbCr ....
ThisDrawing.SendCommand "loremIpsum3" & vbCr ....
I guess this is not a very reliably way of writing information because when some of my peers try to run it on their computers it doesn't work as expected. The problems start when the macro comes to SendCommand lines, it gets out of sync or something and nothing is written. The macro works for some and others just have problems.
Atm we are all using AutoCAD 2016 on our windows computers so it can't be a version issue? To me it seems that they are using other Autocad settings than I am, perhaps how commands are entered or something.
I would like to get some advice how I can make my macro more stable so it works for everyone. Perhaps there is a third party application/environment that I can control and run the macro from, Any suggestions is welcome 🙂
BG