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

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

Anonymous
Not applicable
791 Views
6 Replies
Message 1 of 7

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

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
792 Views
6 Replies
Replies (6)
Message 2 of 7

Alfred.NESWADBA
Consultant
Consultant

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
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 7

Anonymous
Not applicable

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.

 

 

0 Likes
Message 4 of 7

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

Change your line to:

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

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 5 of 7

Anonymous
Not applicable

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 ....

0 Likes
Message 6 of 7

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

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
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 7 of 7

Anonymous
Not applicable
Hi I have found solution and completed what I intended thanks man for your time and knowledge, live long gentleman
0 Likes