Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Start App

17 REPLIES 17
Reply
Message 1 of 18
Anonymous
315 Views, 17 Replies

Start App

I know this works ..... (startapp "notepad" "C:/Extraction/Extract.mns")
with this in acad.pgp ..... NOTEPAD, START NOTEPAD, 1,*File to edit:,

but this dosen't ...... (startapp "excel" "C:/Extraction/Extraction.xls")
with this in acad.pgp ...... EXCEL, START EXCEL, 1,*File to edit:,

Can anyone point me in the right direction?
17 REPLIES 17
Message 2 of 18
Anonymous
in reply to: Anonymous

Chip...
You'll need to provide the complete path to excel...

Tom

"Chip Harper" wrote in message
news:852F8BD2778A6B589DDB6FAE38086AB6@in.WebX.SaUCah8kaAW...
I know this works ..... (startapp "notepad" "C:/Extraction/Extract.mns")
with this in acad.pgp ..... NOTEPAD, START NOTEPAD, 1,*File to edit:,

but this dosen't ...... (startapp "excel" "C:/Extraction/Extraction.xls")
with this in acad.pgp ...... EXCEL, START EXCEL, 1,*File to edit:,

Can anyone point me in the right direction?
Message 3 of 18
Anonymous
in reply to: Anonymous

Ok, makes sense .... I changed the acad.pgp to read ...
EXCEL, START "C:/Program Files/Microsoft Office/Office/Excel.exe",
1,*File to edit:,

Typing EXCEL at the command prompt works .. it prompts for the file to edit,
I give it the path and it opens correctly .... Half way there ..

This .... (startapp "excel" "C:/Extraction/Extraction.xls") returns nil
where as
(startapp "notepad" "C:/Extraction/Extract.mns") opens correctly ... what I
am I missing?

"Tom B" wrote in message
news:965BAC46F032E10763BAC63A0858F510@in.WebX.SaUCah8kaAW...
> Chip...
> You'll need to provide the complete path to excel...
>
> Tom
>
Message 4 of 18
Anonymous
in reply to: Anonymous

(startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
"C:/Extraction/Extraction.xls")

"Chip Harper" wrote in message
news:C66262363F9AC2759E9E0E0F3D7FCD30@in.WebX.SaUCah8kaAW...
Ok, makes sense .... I changed the acad.pgp to read ...
EXCEL, START "C:/Program Files/Microsoft Office/Office/Excel.exe",
1,*File to edit:,

Typing EXCEL at the command prompt works .. it prompts for the file to edit,
I give it the path and it opens correctly .... Half way there ..

This .... (startapp "excel" "C:/Extraction/Extraction.xls") returns nil
where as
(startapp "notepad" "C:/Extraction/Extract.mns") opens correctly ... what I
am I missing?

"Tom B" wrote in message
news:965BAC46F032E10763BAC63A0858F510@in.WebX.SaUCah8kaAW...
> Chip...
> You'll need to provide the complete path to excel...
>
> Tom
>
Message 5 of 18
Anonymous
in reply to: Anonymous

Nope, it will open excel but with the warning that 'extraction.xls' not
found, check path, spelling yada yada.

Leaving the Excel command in the acad.pgp file I wrote a quick script ...

Excel
"C:/Extraction/Extraction.xls"

This opens it to the correct file ... this is driving me nuts. Any idea why
its not working with (startapp)?

And Thanks a Million for your help Tom.

"Tom B" wrote in message
news:70462061BCC27E35B98C22D842A52E72@in.WebX.SaUCah8kaAW...
> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> "C:/Extraction/Extraction.xls")
Message 6 of 18
Anonymous
in reply to: Anonymous

OK... I fixed it. Sometimes I am so stupid.... AutoLISP doesn'r see \ as \
so you use / or \\. Windows doesn't recognise / in directory names... so
you need to set your string up like this:

(startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
"C:\\Extraction\\Extraction.xls")

so windows sees \ because AutoLISP converts \\ to \!!!!

Go ahead... try it!

Tom

"Chip Harper" wrote in message
news:8737277E3C7FE05EA60DCF5A4EB1980C@in.WebX.SaUCah8kaAW...
Nope, it will open excel but with the warning that 'extraction.xls' not
found, check path, spelling yada yada.

Leaving the Excel command in the acad.pgp file I wrote a quick script ...

Excel
"C:/Extraction/Extraction.xls"

This opens it to the correct file ... this is driving me nuts. Any idea why
its not working with (startapp)?

And Thanks a Million for your help Tom.

"Tom B" wrote in message
news:70462061BCC27E35B98C22D842A52E72@in.WebX.SaUCah8kaAW...
> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> "C:/Extraction/Extraction.xls")
Message 7 of 18
Anonymous
in reply to: Anonymous

Yikes, I hate to say it, but no ... I even tried coping and pasting just in
case I had a typo ...

this is what I get at the command line ...
Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe" "C:

"Tom B" wrote in message
news:E8E13584F49ED8085FF9539FE8DAC22A@in.WebX.SaUCah8kaAW...
> OK... I fixed it. Sometimes I am so stupid.... AutoLISP doesn'r see \ as
\
> so you use / or \\. Windows doesn't recognise / in directory names... so
> you need to set your string up like this:
>
> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> "C:\\Extraction\\Extraction.xls")
>
> so windows sees \ because AutoLISP converts \\ to \!!!!
>
> Go ahead... try it!
>
> Tom
Message 8 of 18
Anonymous
in reply to: Anonymous

(startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
"C:\\Extraction\\Extraction.xls")

That all should be on one line... watch for wrap...

"Chip Harper" wrote in message
news:EEAE3EEC71BC4928E1B1FDE60552292B@in.WebX.SaUCah8kaAW...
Yikes, I hate to say it, but no ... I even tried coping and pasting just in
case I had a typo ...

this is what I get at the command line ...
Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe" "C:

"Tom B" wrote in message
news:E8E13584F49ED8085FF9539FE8DAC22A@in.WebX.SaUCah8kaAW...
> OK... I fixed it. Sometimes I am so stupid.... AutoLISP doesn'r see \ as
\
> so you use / or \\. Windows doesn't recognise / in directory names... so
> you need to set your string up like this:
>
> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> "C:\\Extraction\\Extraction.xls")
>
> so windows sees \ because AutoLISP converts \\ to \!!!!
>
> Go ahead... try it!
>
> Tom
Message 9 of 18
Anonymous
in reply to: Anonymous

I put it in as 1 line with a space between the quote marks { .exe" "C:\\ }
and without the space and I get this at the command line ...

Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe" "C:

"Tom B" wrote in message
news:28DA004508DB303BA8EE194A041DBBB9@in.WebX.SaUCah8kaAW...
> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> "C:\\Extraction\\Extraction.xls")
>
> That all should be on one line... watch for wrap...
Message 10 of 18
Anonymous
in reply to: Anonymous

Best I can figure out .. it sees the first \ after the c: as a pause and is
waiting for a entry at the comand line. It it makes any difference this is
being used on a partial menu. Here is the entire line ...

ID_EXCEL [<-Open Excel Worksheet](startapp "C:/Program Files/Microsoft
Office/Office/Excel.exe" "C:\\Extraction\\Extraction.xls")
Message 11 of 18
Anonymous
in reply to: Anonymous

Chip... you are killing me here... Here is the result on my A2k command
line:

Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
(_> "C:\\Extraction\\Extraction.xls")
-31641

And here is the result on my A14:

Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"

1> "C:\\Extraction\\Extraction.xls")
35151

and in IntelliCAD
(startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
"C:\\Extraction\\Extraction.xls")
38157

You can also leave out the space in between Excel.exe" "C:\Extract... like
below:

(startapp "C:/Program Files/Microsoft
Office/Office/Excel.exe""C:\\Extraction\\Extraction.xls")

Tom

"Chip Harper" wrote in message
news:8081E7B5DE20F5CE7C96D1360C4F1852@in.WebX.SaUCah8kaAW...
I put it in as 1 line with a space between the quote marks { .exe" "C:\\ }
and without the space and I get this at the command line ...

Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe" "C:

"Tom B" wrote in message
news:28DA004508DB303BA8EE194A041DBBB9@in.WebX.SaUCah8kaAW...
> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> "C:\\Extraction\\Extraction.xls")
>
> That all should be on one line... watch for wrap...
Message 12 of 18
Anonymous
in reply to: Anonymous

It works directly at the command line but not as part of a partial menu, as
I was trying to use it. Wacky stuff. Thanks Tom.

"Tom B" wrote in message
news:D277C20EEE73E909DF59144901B6B2D8@in.WebX.SaUCah8kaAW...
> Chip... you are killing me here... Here is the result on my A2k command
> line:
>
> Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> (_> "C:\\Extraction\\Extraction.xls")
> -31641
>
> And here is the result on my A14:
>
> Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
>
> 1> "C:\\Extraction\\Extraction.xls")
> 35151
>
> and in IntelliCAD
> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> "C:\\Extraction\\Extraction.xls")
> 38157
>
> You can also leave out the space in between Excel.exe" "C:\Extract... like
> below:
>
> (startapp "C:/Program Files/Microsoft
> Office/Office/Excel.exe""C:\\Extraction\\Extraction.xls")
>
> Tom
>
> "Chip Harper" wrote in message
> news:8081E7B5DE20F5CE7C96D1360C4F1852@in.WebX.SaUCah8kaAW...
> I put it in as 1 line with a space between the quote marks { .exe" "C:\\ }
> and without the space and I get this at the command line ...
>
> Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
"C:
>
> "Tom B" wrote in message
> news:28DA004508DB303BA8EE194A041DBBB9@in.WebX.SaUCah8kaAW...
> > (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
> > "C:\\Extraction\\Extraction.xls")
> >
> > That all should be on one line... watch for wrap...
>
Message 13 of 18
Anonymous
in reply to: Anonymous

I test Tom line and it works fine here too

(startapp (findfile
"C:/Program Files/Microsoft Office/Office/Excel.exe"
) ;_ eoffindfile
(if (setq myxls (findfile "C:\\Extraction\\Extraction.xls"))
myxls
) ;_ eofif
) ;_ eofstartapp

(startapp
(if (setq xls (findfile
"C:/Program Files/Microsoft Office/Office/Excel.exe"
) ;_ eoffindfile
) ;_ eofsetq
xls
) ;_ eofif
(if (setq book (findfile "C:\\Extraction\\Extraction.xls"))
book
) ;_ eofif
) ;_ eofstartapp

Good Luck,
LE

Tom B wrote in message ...
>Chip... you are killing me here... Here is the result on my A2k command
>line:
>
>Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
>(_> "C:\\Extraction\\Extraction.xls")
>-31641
>
>And here is the result on my A14:
>
>Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
>
>1> "C:\\Extraction\\Extraction.xls")
>35151
>
>and in IntelliCAD
>(startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
>"C:\\Extraction\\Extraction.xls")
>38157
>
>You can also leave out the space in between Excel.exe" "C:\Extract... like
>below:
>
>(startapp "C:/Program Files/Microsoft
>Office/Office/Excel.exe""C:\\Extraction\\Extraction.xls")
>
>Tom
>
>"Chip Harper" wrote in message
>news:8081E7B5DE20F5CE7C96D1360C4F1852@in.WebX.SaUCah8kaAW...
>I put it in as 1 line with a space between the quote marks { .exe" "C:\\ }
>and without the space and I get this at the command line ...
>
>Command: (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe" "C:
>
>"Tom B" wrote in message
>news:28DA004508DB303BA8EE194A041DBBB9@in.WebX.SaUCah8kaAW...
>> (startapp "C:/Program Files/Microsoft Office/Office/Excel.exe"
>> "C:\\Extraction\\Extraction.xls")
>>
>> That all should be on one line... watch for wrap...
>
Message 14 of 18
Anonymous
in reply to: Anonymous

ID_EXCEL [<-Open Excel Worksheet](startapp "C:/Program Files/Microsoft
+Office/Office/Excel.exe" "C:\\Extraction\\Extraction.xls")

"Chip Harper" wrote in message
news:51C47530810AB235F1A8C08157C8B6DE@in.WebX.SaUCah8kaAW...
Best I can figure out .. it sees the first \ after the c: as a pause and is
waiting for a entry at the comand line. It it makes any difference this is
being used on a partial menu. Here is the entire line ...

ID_EXCEL [<-Open Excel Worksheet](startapp "C:/Program Files/Microsoft
Office/Office/Excel.exe" "C:\\Extraction\\Extraction.xls")
Message 15 of 18
Anonymous
in reply to: Anonymous

Chip,

The reason that your code do not fit in one line you need to add "+", but
when the mns is created line continuation are not preserved

your choice can be something like this ...

(defun openExcel ()
(startapp
(if (setq xls (findfile
"C:/Program Files/Microsoft Office/Office/Excel.exe"
) ;_ eoffindfile
) ;_ eofsetq
xls
) ;_ eofif
(if (setq book (findfile "C:\\Extraction\\Extraction.xls"))
; book
; ) ;_ eofif
) ;_ eofstartapp
(princ)
) ;_ eofdefun

[&Open Excel Worksheet]^C^C(openExcel)

Good Luck,

Chip Harper wrote in message
<51C47530810AB235F1A8C08157C8B6DE@in.WebX.SaUCah8kaAW>...
>Best I can figure out .. it sees the first \ after the c: as a pause and is
>waiting for a entry at the comand line. It it makes any difference this is
>being used on a partial menu. Here is the entire line ...
>
>ID_EXCEL [<-Open Excel Worksheet](startapp "C:/Program
Files/Microsoft
>Office/Office/Excel.exe" "C:\\Extraction\\Extraction.xls")
>
Message 16 of 18
Anonymous
in reply to: Anonymous

Chip...
Did you see the plus sign in my last post?

ID_EXCEL [<-Open Excel Worksheet](startapp "C:/Program Files/Microsoft
+Office/Office/Excel.exe" "C:\\Extraction\\Extraction.xls")

That should square you away!

Tom
Message 17 of 18
Anonymous
in reply to: Anonymous

Yes I did Tom, just haven't had a chance to post back. Can you believe some
people actually expect you to do work on a friday? Everything is running
smoothly, Thanks for all your assistance Tom. Greatly appreciated.

"Tom B" wrote in message
news:E79DDB3A21092D7093E59B956D7D3EEF@in.WebX.SaUCah8kaAW...
> Chip...
> Did you see the plus sign in my last post?
>
> ID_EXCEL [<-Open Excel Worksheet](startapp "C:/Program
Files/Microsoft
> +Office/Office/Excel.exe" "C:\\Extraction\\Extraction.xls")
>
> That should square you away!
>
> Tom
>
Message 18 of 18
Anonymous
in reply to: Anonymous

Chip...
You are welcome. As far as working on friday goes.... I had 60 hours when
I went home last nite... and they expected me to work 8 today... not
likely!

Tom

"Chip Harper" wrote in message
news:2E4896EDDA1B6D28BA2601B44C444665@in.WebX.SaUCah8kaAW...
> Yes I did Tom, just haven't had a chance to post back. Can you believe
some
> people actually expect you to do work on a friday? Everything is running
> smoothly, Thanks for all your assistance Tom. Greatly appreciated.
>
> "Tom B" wrote in message
> news:E79DDB3A21092D7093E59B956D7D3EEF@in.WebX.SaUCah8kaAW...
> > Chip...
> > Did you see the plus sign in my last post?
> >
> > ID_EXCEL [<-Open Excel Worksheet](startapp "C:/Program
> Files/Microsoft
> > +Office/Office/Excel.exe" "C:\\Extraction\\Extraction.xls")
> >
> > That should square you away!
> >
> > Tom
> >
>

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

Post to forums  

”Boost