MEUserII
Board Regular
- Joined
- Oct 27, 2017
- Messages
- 91
- Office Version
- 365
- 2021
- 2019
- 2016
- 2013
- Platform
- Windows
Is there a way to send keys inside of a batch script (.bat file) on Windows 10 to Excel 2016? For example, this link below provides an example on how to send keys in a batch script (.bat) to Word using the following commands:
Link: https://itstillworks.com/12456076/how-to-press-buttons-in-batch-file
However, this does not seem to be working for me. As I get following error:
So, how would I be able to send keys in a batch script on Windows 10 to Excel 2016?
</code></code></code></code>
Link: https://itstillworks.com/12456076/how-to-press-buttons-in-batch-file
Code:
<code class="language-markup">
cd C:\Program Files (x86)\Microsoft Office\Office14</code><code class="language-markup">
start /w WinWord.exe</code>
<code class="language-markup"></code><code class="language-markup"></code><code class="language-markup"><code class="language-markup">WshShell.Sendkeys "%f"</code></code>
<code class="language-markup"><code class="language-markup"></code></code><code class="language-markup"><code class="language-markup"><code class="language-markup">WshShell.Sendkeys “n”</code></code></code>
<code class="language-markup"><code class="language-markup"><code class="language-markup"></code></code></code><code class="language-markup"></code><code class="language-markup"><code class="language-markup"><code class="language-markup"><code class="language-markup">WshShell.Sendkeys "{Enter}"
However, this does not seem to be working for me. As I get following error:
'Wsh.Shell.SendKeys' is not recognized as an internal or external command, operable program or batch file."
So, how would I be able to send keys in a batch script on Windows 10 to Excel 2016?
</code></code></code></code>