<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sendkey Command Has Trouble Working in a Dialog Box in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256201#M45942</link>
    <description>Hello Nathan,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply.&lt;BR /&gt;
&lt;BR /&gt;
I am not sure  but I think  that is the same or close to the  VB6 sendkeys boolean option which is the second argument in the SendKeys, I have not really used that second argument. &lt;BR /&gt;
&lt;BR /&gt;
Sendkeys  stringToSend, boolean &lt;BR /&gt;
&lt;BR /&gt;
I think it  deals with the timing when the string is sent via sendkeys. I do not know if it  has  the ability to control which thread receives the strings sent by sendkeys. &lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
    <pubDate>Thu, 24 Feb 2005 23:50:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-02-24T23:50:26Z</dc:date>
    <item>
      <title>Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256190#M45931</link>
      <description>I am trying to trigger a series of about 10 sendkeys statements which I am trying to run from VBA.&lt;BR /&gt;
&lt;BR /&gt;
What I notice with said sendkeys series of statements is it seems to be able to execute the first sendkeys call as I intended it, i.e. pop out a dialog box  but then the -- 2nd to the 10th sendkeys call all end up on the command line instead of going to the dialog box (popped out by my first sendkeys statement) of which I intended all the those sendkeys statements to go.&lt;BR /&gt;
&lt;BR /&gt;
The command buttons are not triggerable from the command line of AutoCAD -- so I really have no choice but to try to manipulate those command buttons using sendkeys.  &lt;BR /&gt;
&lt;BR /&gt;
Please help me with any idea you have in mind. &lt;BR /&gt;
&lt;BR /&gt;
Gratefully,&lt;BR /&gt;
Matt</description>
      <pubDate>Thu, 24 Feb 2005 17:37:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256190#M45931</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T17:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256191#M45932</link>
      <description>Sounds like after you have the new dialog box pop up you haven't set focus to it to receive the commands.</description>
      <pubDate>Thu, 24 Feb 2005 17:52:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256191#M45932</guid>
      <dc:creator>Mikko</dc:creator>
      <dc:date>2005-02-24T17:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256192#M45933</link>
      <description>You have to send the key strokes from outside. It could be VB, VBScript, 
Excel VBA but not from within AutoCAD VBA.

-- 
Best Regards, Jimmy Bergmark
CAD and Database Developer Manager at www.pharmadule-emtunga.com
Blog: http://jtbworld.blogspot.com
JTB FlexReport (FLEXnet / FLEXlm report tool) - 
www.jtbworld.com/jtbflexreport
SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm
or download some freeware at www.jtbworld.com
More on AutoCAD 2005;
www.jtbworld.com/autocad2005.htm


"matt_1ca" &lt;NOSPAM&gt; wrote in message 
news:6440916.1109266700176.JavaMail.jive@jiveforum2.autodesk.com...
&amp;gt;I am trying to trigger a series of about 10 sendkeys statements which I am 
&amp;gt;trying to run from VBA.
&amp;gt;
&amp;gt; What I notice with said sendkeys series of statements is it seems to be 
&amp;gt; able to execute the first sendkeys call as I intended it, i.e. pop out a 
&amp;gt; dialog box  but then the -- 2nd to the 10th sendkeys call all end up on 
&amp;gt; the command line instead of going to the dialog box (popped out by my 
&amp;gt; first sendkeys statement) of which I intended all the those sendkeys 
&amp;gt; statements to go.
&amp;gt;
&amp;gt; The command buttons are not triggerable from the command line of 
&amp;gt; AutoCAD -- so I really have no choice but to try to manipulate those 
&amp;gt; command buttons using sendkeys.
&amp;gt;
&amp;gt; Please help me with any idea you have in mind.
&amp;gt;
&amp;gt; Gratefully,
&amp;gt; Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 24 Feb 2005 18:06:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256192#M45933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T18:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256193#M45934</link>
      <description>Hello Mikko,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for you reply, but dialog box that pops out automatically has the focus .. good example is  sendkeys "%(FO)"  -- file dialog box opens up but succeeding  sendkeys calls dont go to that dialog box instead my observation is that it is going to the command line.&lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
      <pubDate>Thu, 24 Feb 2005 19:09:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256193#M45934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T19:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256194#M45935</link>
      <description>Hello Jimmy, &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply, I am trying your suggestion right now -- i.e. calling sendkeys from VB standalone, I notice right away that  its a bit more manageable but still the problem persists -- I will look at it more intently and run more tests. &lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
      <pubDate>Thu, 24 Feb 2005 19:14:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256194#M45935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T19:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256195#M45936</link>
      <description>Hi Matt,

You may find it easier to avoid opening the dialog box.  Set Filedia = 0 and
CmdDia = 0 and send the keys.

Try it from the command line first to see exactly what you need.

-- 


Laurie Comerford
CADApps
www.cadapps.com.au

"matt_1ca" &lt;NOSPAM&gt; wrote in message
news:6440916.1109266700176.JavaMail.jive@jiveforum2.autodesk.com...
&amp;gt; I am trying to trigger a series of about 10 sendkeys statements which I am
trying to run from VBA.
&amp;gt;
&amp;gt; What I notice with said sendkeys series of statements is it seems to be
able to execute the first sendkeys call as I intended it, i.e. pop out a
dialog box  but then the -- 2nd to the 10th sendkeys call all end up on the
command line instead of going to the dialog box (popped out by my first
sendkeys statement) of which I intended all the those sendkeys statements to
go.
&amp;gt;
&amp;gt; The command buttons are not triggerable from the command line of
AutoCAD -- so I really have no choice but to try to manipulate those command
buttons using sendkeys.
&amp;gt;
&amp;gt; Please help me with any idea you have in mind.
&amp;gt;
&amp;gt; Gratefully,
&amp;gt; Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 24 Feb 2005 21:16:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256195#M45936</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T21:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256196#M45937</link>
      <description>The next thing I did was to get the Hwnd for AutoCAD and use SetForegroundWindow on it.  What it does is just go and pull down the necessary file menu from the top menu.  Which means that when I do a :&lt;BR /&gt;
&lt;BR /&gt;
SendKeys "%(FO)" &lt;BR /&gt;
SendKeys "{TAB 11}"&lt;BR /&gt;
SendKeys "{DOWN 1}"&lt;BR /&gt;
SendKeys "{ENTER}"&lt;BR /&gt;
&lt;BR /&gt;
I am expecting that it will open for me my file mama.dwg   -- but the only thing it does is  do  the equivalent of  SendKeys "%F"   i.e. it is just pulling down the drop down menu.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for all the kind help you can extend on this matter.&lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
      <pubDate>Thu, 24 Feb 2005 21:30:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256196#M45937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T21:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256197#M45938</link>
      <description>Matt,
What are the SendKeys statements attempting to do?
You may be able to accomplish what you need without using SendKeys or
SendCommand.  This would make your code much more stable.

James


"matt_1ca" &lt;NOSPAM&gt; wrote in message
news:6440916.1109266700176.JavaMail.jive@jiveforum2.autodesk.com...
&amp;gt; I am trying to trigger a series of about 10 sendkeys statements which I am
trying to run from VBA.
&amp;gt;
&amp;gt; What I notice with said sendkeys series of statements is it seems to be
able to execute the first sendkeys call as I intended it, i.e. pop out a
dialog box  but then the -- 2nd to the 10th sendkeys call all end up on the
command line instead of going to the dialog box (popped out by my first
sendkeys statement) of which I intended all the those sendkeys statements to
go.
&amp;gt;
&amp;gt; The command buttons are not triggerable from the command line of
AutoCAD -- so I really have no choice but to try to manipulate those command
buttons using sendkeys.
&amp;gt;
&amp;gt; Please help me with any idea you have in mind.
&amp;gt;
&amp;gt; Gratefully,
&amp;gt; Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 24 Feb 2005 21:33:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256197#M45938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T21:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256198#M45939</link>
      <description>What are you doing exactly as there may be a better way of doing it.&lt;BR /&gt;
Regards - Nathan</description>
      <pubDate>Thu, 24 Feb 2005 21:45:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256198#M45939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T21:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256199#M45940</link>
      <description>Hello Nathan,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply -- here is the additional information:&lt;BR /&gt;
&lt;BR /&gt;
There is a third party application making AutoCAD work with a separate Spatial Database. But its API does not expose all the functions that I need which prevents me from working full blast without using interactive sendkeys.  &lt;BR /&gt;
&lt;BR /&gt;
My task is this:  users can work with it manually but it is taking to much time so I need to  automate  their repetitive  task of interactively clicking on each of those dialog boxes that the 3rd party application uses.&lt;BR /&gt;
&lt;BR /&gt;
Third party application creates a drop down menu addition to the standard AutoCAD menu. And that drop down menu is where I am supposed to start the automation process.&lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
      <pubDate>Thu, 24 Feb 2005 22:34:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256199#M45940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T22:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256200#M45941</link>
      <description>VB.NET has a SendKeys.Send method that just sends the keys and a SendKeys.SendWait that sends the keys and waits for them to be processed.&lt;BR /&gt;
Regards - Nathan</description>
      <pubDate>Thu, 24 Feb 2005 22:48:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256200#M45941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T22:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256201#M45942</link>
      <description>Hello Nathan,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply.&lt;BR /&gt;
&lt;BR /&gt;
I am not sure  but I think  that is the same or close to the  VB6 sendkeys boolean option which is the second argument in the SendKeys, I have not really used that second argument. &lt;BR /&gt;
&lt;BR /&gt;
Sendkeys  stringToSend, boolean &lt;BR /&gt;
&lt;BR /&gt;
I think it  deals with the timing when the string is sent via sendkeys. I do not know if it  has  the ability to control which thread receives the strings sent by sendkeys. &lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
      <pubDate>Thu, 24 Feb 2005 23:50:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256201#M45942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-24T23:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256202#M45943</link>
      <description>Hello Laurie,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply.&lt;BR /&gt;
&lt;BR /&gt;
Your idea has given me a good start, out of the seven clicks on the dialog boxes your technique allowed me to find a way to call two of those clicks from the command line -- I still need to click five buttons though, and I am not finding it possible from command line.&lt;BR /&gt;
&lt;BR /&gt;
Setting cmddia/filedia to zero has not gotten rid of the dialog box --  I think they are like dialog boxes used by vbaman which are not disabled despite cmddia/filedia settings of zero.&lt;BR /&gt;
&lt;BR /&gt;
Even though cmddia/filedia did not disable the dialog boxes that  pop out  your idea made me look into the command line to see what commands are being pumped in the command line that I was able to use to my advantage.  &lt;BR /&gt;
&lt;BR /&gt;
Those other five buttons dont show any corresponding commands in the command line,  so I cannot call them the way I called the other two. One of those five buttons for example activates a browser window to select files to use as templates for spatial data extraction and repopulating AutoCAD based on user's new SQL etc.&lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
      <pubDate>Fri, 25 Feb 2005 00:12:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256202#M45943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-25T00:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256203#M45944</link>
      <description>Hi Matt,

Once you establish that you cannot avoid a dialog box from another program
with SendKey/SendCommand type processes, then the next step it to bypass the
dialog box and write your own code to perform the functions behind the
dialog box.

If the whole function behind the dialog box is too complex for you to code,
then ultimately you may be better off opening the box and allowing the user
to process it manually.

If you are totally insistent of using the dialog box, the next level of
complexity may be to drive mouse clicks at the relevant screen coordinates
of the items on the form.

-- 


Laurie Comerford
CADApps
www.cadapps.com.au

"matt_1ca" &lt;NOSPAM&gt; wrote in message
news:19101957.1109290375034.JavaMail.jive@jiveforum1.autodesk.com...
&amp;gt; Hello Laurie,
&amp;gt;
&amp;gt; Thank you for your reply.
&amp;gt;
&amp;gt; Your idea has given me a good start, out of the seven clicks on the dialog
boxes your technique allowed me to find a way to call two of those clicks
from the command line -- I still need to click five buttons though, and I am
not finding it possible from command line.
&amp;gt;
&amp;gt; Setting cmddia/filedia to zero has not gotten rid of the dialog box --  I
think they are like dialog boxes used by vbaman which are not disabled
despite cmddia/filedia settings of zero.
&amp;gt;
&amp;gt; Even though cmddia/filedia did not disable the dialog boxes that  pop out
your idea made me look into the command line to see what commands are being
pumped in the command line that I was able to use to my advantage.
&amp;gt;
&amp;gt; Those other five buttons dont show any corresponding commands in the
command line,  so I cannot call them the way I called the other two. One of
those five buttons for example activates a browser window to select files to
use as templates for spatial data extraction and repopulating AutoCAD based
on user's new SQL etc.
&amp;gt;
&amp;gt; Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Fri, 25 Feb 2005 08:47:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256203#M45944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-25T08:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256204#M45945</link>
      <description>Hello Laurie,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply.&lt;BR /&gt;
&lt;BR /&gt;
Actually I am not really that sure if there is just  a magical trick about sendkeys  that I am missing out on. &lt;BR /&gt;
&lt;BR /&gt;
For example  I know that for usual applications sendkeys is called after a call to AppActivate -- but I am not sure how or if its supposed to be implemented in AutoCAD.  I am only guessing that it is not needed in AutoCAD because it is already the active application.&lt;BR /&gt;
&lt;BR /&gt;
There is also another issue about how to implement a modeless form (again I am not sure how critical that is .. what I did was just  to do a me.hide ) --  there is a gray area there because I am not understanding the why/how behind it and I am not quite sure if it is the one stopping me from properly using sendkeys with AutoCAD.  &lt;BR /&gt;
&lt;BR /&gt;
In your experience what are the common pitfalls of people who are trying to use sendkeys in AutoCAD?&lt;BR /&gt;
&lt;BR /&gt;
Matt</description>
      <pubDate>Fri, 25 Feb 2005 15:34:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256204#M45945</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-25T15:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256205#M45946</link>
      <description>Matt,

This will be very hard to code and very unpredicted in behaviour if you rely
on several SendKey sequences. Maybe most important thing is that key
sequences sent out of VB/VBA are not in synch with what ACAD is really
processing at the moment. The only viable solution is, as Nathan said, using
VB.NET's SendKeys.SendWait method. There's also a solution to GetObject ACAD
externally, send a key sequence and check for command line results (in the
meantime DoEvents must be in progress), responding to them accordingly. Did
you try LISP's (Command "..." "..." "...")?

Regards,
Maksim Sestic

"matt_1ca" &lt;NOSPAM&gt; wrote in message
news:31022006.1109284525110.JavaMail.jive@jiveforum1.autodesk.com...
&amp;gt; Hello Nathan,
&amp;gt;
&amp;gt; Thank you for your reply -- here is the additional information:
&amp;gt;
&amp;gt; There is a third party application making AutoCAD work with a separate
Spatial Database. But its API does not expose all the functions that I need
which prevents me from working full blast without using interactive
sendkeys.
&amp;gt;
&amp;gt; My task is this:  users can work with it manually but it is taking to much
time so I need to  automate  their repetitive  task of interactively
clicking on each of those dialog boxes that the 3rd party application uses.
&amp;gt;
&amp;gt; Third party application creates a drop down menu addition to the standard
AutoCAD menu. And that drop down menu is where I am supposed to start the
automation process.
&amp;gt;
&amp;gt; Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Fri, 25 Feb 2005 17:23:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256205#M45946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-25T17:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256206#M45947</link>
      <description>Matt,
One problem with SendKeys is that the user can do things between when the
program starts running and when the keys get sent that can disrupt the
sequence.  For example, I have a VBA app that has to open and close the page
setup dialog box to get plot settings to stick (at least that was the only
way I could find).  So I do a SendKeys {ENTER} to close the dialog box right
before I do a SendCommand "PAGESETUP".  9 times out of 10 it works fine...
but if the user hits ENTER after they run the macro, but before it gets to
my PageSetup call, for some reason it causes the dialog box to sit there
open waiting for them to close it.  No problem with my simple program, but
it would be a disaster for a complicated database routine.  Hmmm...maybe if
I could clear the keyboard buffer right before my SendKeys this would not
happen... I will investigate.... thanks for the idea.

Just my 0.02...

James

"matt_1ca" &lt;NOSPAM&gt; wrote in message
news:12075357.1109345683417.JavaMail.jive@jiveforum1.autodesk.com...
&amp;gt; Hello Laurie,
&amp;gt;
&amp;gt; Thank you for your reply.
&amp;gt;
&amp;gt; Actually I am not really that sure if there is just  a magical trick about
sendkeys  that I am missing out on.
&amp;gt;
&amp;gt; For example  I know that for usual applications sendkeys is called after a
call to AppActivate -- but I am not sure how or if its supposed to be
implemented in AutoCAD.  I am only guessing that it is not needed in AutoCAD
because it is already the active application.
&amp;gt;
&amp;gt; There is also another issue about how to implement a modeless form (again
I am not sure how critical that is .. what I did was just  to do a
me.hide ) --  there is a gray area there because I am not understanding the
why/how behind it and I am not quite sure if it is the one stopping me from
properly using sendkeys with AutoCAD.
&amp;gt;
&amp;gt; In your experience what are the common pitfalls of people who are trying
to use sendkeys in AutoCAD?
&amp;gt;
&amp;gt; Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Fri, 25 Feb 2005 17:24:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256206#M45947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-25T17:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256207#M45948</link>
      <description>Hello James,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply --&lt;BR /&gt;
&lt;BR /&gt;
What my sendkeys try to do is  to click a cascaded menu item from a top menu (third party sitting along with all the other AutoCAD standard top menu).  Then to change the content of a drop down list and  click a command button from the dialog box that that cascaded menu item click activates&lt;BR /&gt;
&lt;BR /&gt;
There are  two or three more clicks I need to send from the next dialog box activated from the first dialog box command button click but initially the above describes what I need to do. &lt;BR /&gt;
&lt;BR /&gt;
I need to do everything I described without any user intervention and right now I moved all the code to VB.&lt;BR /&gt;
&lt;BR /&gt;
I am right now looking into your suggestion -- I am trying to see if there is another way to do it -- I am also looking at Laurie's suggestion on driving the mouse using code thanks.&lt;BR /&gt;
&lt;BR /&gt;
Gratefully,&lt;BR /&gt;
Matt</description>
      <pubDate>Sun, 27 Feb 2005 15:14:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256207#M45948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-27T15:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256208#M45949</link>
      <description>Hello Maksim,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply. I really appreciate it.&lt;BR /&gt;
&lt;BR /&gt;
Two commands out of those seven I can check  as you are suggesting. (The first time I tried using those was when Laurie suggested that I try to manipulate cmddia and filedia.)   &lt;BR /&gt;
&lt;BR /&gt;
Unfortunately the other five do not send anything at all to the command line -- they look like they trigger  internal data passes and manipulation using data between two dialog boxes successively triggered by clicks on command buttons owned by those two dialog boxes i.e. they leave no trace at all on the command line. So solving those five remaining clicks using (Command ".."  "..") is not likely.&lt;BR /&gt;
&lt;BR /&gt;
Gratefully,&lt;BR /&gt;
Matt</description>
      <pubDate>Sun, 27 Feb 2005 15:56:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256208#M45949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-27T15:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sendkey Command Has Trouble Working in a Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256209#M45950</link>
      <description>Hi Matt,

The command in the menu can be run by finding the function the menu calls
and calling it directly.  That will reduce the complexity of your
sendcommand, so that you are not calling the menu.

I think you should give some more detail of what you are trying to do.  That
way you will be able to get better help.

Start with the principle that you should not be using SendCommand unless you
absolutely have too and see where you go from that.

-- 


Laurie Comerford
CADApps
www.cadapps.com.au

"matt_1ca" &lt;NOSPAM&gt; wrote in message
news:27505176.1109517324189.JavaMail.jive@jiveforum2.autodesk.com...
&amp;gt; Hello James,
&amp;gt;
&amp;gt; Thanks for your reply --
&amp;gt;
&amp;gt; What my sendkeys try to do is  to click a cascaded menu item from a top
menu (third party sitting along with all the other AutoCAD standard top
menu).  Then to change the content of a drop down list and  click a command
button from the dialog box that that cascaded menu item click activates
&amp;gt;
&amp;gt; There are  two or three more clicks I need to send from the next dialog
box activated from the first dialog box command button click but initially
the above describes what I need to do.
&amp;gt;
&amp;gt; I need to do everything I described without any user intervention and
right now I moved all the code to VB.
&amp;gt;
&amp;gt; I am right now looking into your suggestion -- I am trying to see if there
is another way to do it -- I am also looking at Laurie's suggestion on
driving the mouse using code thanks.
&amp;gt;
&amp;gt; Gratefully,
&amp;gt; Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Sun, 27 Feb 2005 20:14:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendkey-command-has-trouble-working-in-a-dialog-box/m-p/1256209#M45950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-27T20:14:27Z</dc:date>
    </item>
  </channel>
</rss>

