.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 4
sarch
578 Views, 3 Replies

Macro Name

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.

 

3 REPLIES 3
Message 2 of 4
architectOfIdeas
in reply to: sarch

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

Message 3 of 4
sarch
in reply to: architectOfIdeas

Thanks Drew

I am not sure how a simple enter allows the program to continue either it does not make sense.

I have tried scripting it but it does not work it's till prompting for Macro Name:

I will try the Visual Basic customization Thank you


Stella Arch MSc.
Quality/CAD Manager
BMT Nigel Gee Ltd

Tel: +44 (0)23 8022 6655
Direct: +44 (0)23 8021 0281
Fax: +44 (0)23 8022 8855

Website: www.bmtng.comwww.bmtyachts.com

[Description: Description: BMT Nigel Gee Ltd logo (new email logo)]
LinkedIn| Twitter | Facebook | YouTube
BMT Nigel Gee Ltd, Building 14, Shamrock Quay, William Street, Southampton, Hampshire, SO14 5QL, United Kingdom

Registered in England, Registered no. 02718748, Registered office Goodrich House, 1 Waldegrave Road, Teddington, Middlesex, TW11 8LZ, UK.




________________________________

Unless otherwise agreed by BMT Nigel Gee Ltd in writing, all work, services, goods or products supplied by BMT Nigel Gee Ltd shall be subject to and governed by BMT Nigel Gee Ltd's own terms and conditions which are available for inspection from BMT Nigel Gee Ltd on request.
E-mail confidentiality notice and disclaimer:
The contents of this e-mail and any attachments are intended for the use of the mail addressee(s) shown. If you are not that person, you are not allowed to read it, to take any action based upon it or to copy it, forward, distribute or disclose the contents of it and you should please delete it from your system. BMT Nigel Gee Ltd does not accept liability for any errors or omissions in the context of this e-mail or its attachments which arise as a result of internet transmission, nor accept liability for statements which are those of the author and clearly not made on behalf of BMT Nigel Gee Ltd.
Please consider the environmental impacts of printing this email, and only do so if really necessary
Message 4 of 4
architectOfIdeas
in reply to: sarch

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost