VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i have a scr file help me how to access it from the excell and run it in the cad

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
inventordeepan
494 Views, 6 Replies

i have a scr file help me how to access it from the excell and run it in the cad

hi i have a scr file in a particular location say :d/test.scr , i want to run this file in autocad but not by opening autocad but by opening a excell document thru vba code any one knows code to run scr file in autocad ,

 

i know code to open autocad from the excel...

plse help asap ...

thank you inadvance. :smileywink

6 REPLIES 6
Message 2 of 7

Hi,

 

if you know the code that opens and accesses AutoCAD from Excel-VBA then run your scr by using SendCommand("_SCRIPT" & vbcr & ...).

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 7

hi i thank you fr your reply if  i use send command option i need to press enter in autocad command prompt to execute the command passed so tell me some solution regarding how can i elimate manual input required to start the command passed .

 

ex

 

acad.activedocument.sendcommand("line" )

 

 

above code display line command in autocad commandprompt but i have to give enter to start the command line passed any one help me how can i avoid using enter key to start the autocad.

 

 

Message 4 of 7

Hi,

 

Change your line to:

acad.activedocument.sendcommand("line" & vbCr)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 7

hi pal what if i have to run a autolisp custom command say "check"and i use the code

Acad.activedocument.sendcommand("check" & vbCr )

 

the above code doesn't work it shows ; error: bad argument type: VLA-OBJECT nil

 

 

can any one solve this

 

but if i type check in autocac command prompt and press enter by autolisp command check works ....

Message 6 of 7

Hi,

 

>> if i have to run a autolisp custom command say "check"and i use the code

>> Acad.activedocument.sendcommand("check" & vbCr )

Can you please describe a little bit more detailed what you like to do exactly?

 

Because you say you run an AutoLISP command ... but what you show is a VB/A syntax.

From LISP the call of a line (if you need to use "command") is:

 

   (command "_LINE")

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 7 of 7

Hi I have found solution and completed what I intended thanks man for your time and knowledge, live long gentleman

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

Post to forums  

Autodesk Design & Make Report

”Boost