I have a vba program that starts in an active drawing.
It copies the active drawing to another location
It opens the copied drawing while keeping the initial drawing open
I then want to do some stuff in the program on the copied drawing that is now open and active in AutoCAD.
However the program stops because at the command prompt it is asking for Macro Name:
If I hit the return key at this point the program continues and works as I wish.
How can I either stop AutoCAD from asking me for the Macro Name or catch it in the program so I respond with a return key vbCr for example.
Thankyou in anticipation
Stella Arch MSc.
Hi Stella,
Is the prompt for the macro name part of your program? If not, I imagine it's the same prompt that you'd see if you typed -VBARUN, yeah?
I'm wondering how a simple enter allows you to continue. You're not typing in the name of the macro (like Project.Module.Test)?
If a simple vbCr allows you to continue, surely it could be scripted. Perhaps post your code if you're having troubles finding how to do this.
Try posting the question in the Visual Basic Customization forum as well, where you may receive a more immediate solution.
Drew
Stella,
Now that I think about it (it's been a while since I've worked with VBA), this sounds familiar to an issue I've had in the past where I was running the macro within the ActiveDocument object when I should have been running the macro within the Application object. Perhaps check it out in the AutoCAD ActiveX and VBA Reference help file. Application has a .RunMacro method and this may be the key. If you are starting a VBA macro within the ActiveDocument, it will not know to back out to the Application object and redefine the ActiveDocument to the new copied drawing.
Drew