satmisha
asked on
Why use of Application.SendKeys is not good coding practice in VBA, excel 2010
Hi Team,
I came to know the use of Application.SendKeys is not a good coding practice better to use windows API to achieve this functionality, I want to know why it is not good coding practice and its impact on the system. I appreciate if you could provide in support some link from microsoft/Authentic to justify the same.
Hopefully looking forward to hearing from you.
Regards,
I came to know the use of Application.SendKeys is not a good coding practice better to use windows API to achieve this functionality, I want to know why it is not good coding practice and its impact on the system. I appreciate if you could provide in support some link from microsoft/Authentic to justify the same.
Hopefully looking forward to hearing from you.
Regards,
Here are some examples of using SendKeys to do things in Excel that can't be done with the Excel object model:
http://blog.contextures.com/archives/2013/01/29/problems-with-sendkeys-in-excel/
Kevin
http://blog.contextures.com/archives/2013/01/29/problems-with-sendkeys-in-excel/
Kevin
ASKER
Thanks Sir for your prompt reply.
But still seems my question is undone, may be I haven't mentioned it clearly, let me rephrase these:
1. Why Application.SendKeys is considered as bad practice and its impact on system.
2. Is there a better way to use replace this.
3. I appreciate if you could provide any supporting document for this.
Hopefully looking forward to hearing from you.
But still seems my question is undone, may be I haven't mentioned it clearly, let me rephrase these:
1. Why Application.SendKeys is considered as bad practice and its impact on system.
2. Is there a better way to use replace this.
3. I appreciate if you could provide any supporting document for this.
Hopefully looking forward to hearing from you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The first better method to automate other applications was DDE or Dynamic Data Exchange:
http://en.wikipedia.org/wiki/Dynamic_Data_Exchange
These days it's much more common and preferable to use OLE or Object Linking and Embedding:
http://en.wikipedia.org/wiki/Object_Linking_and_Embedding
Only in extreme cases and when DDE/OLE are unavailable do we use SendKeys.
Kevin