Microsoft
Software
Hardware
Network
Question : SendKeys in mex file
Hey-- I have an Excel workbook containing macros that needs to be opened and run automatically with a Matlab EXE file. I have the VBA macros in an Auto_Open sub so that they are run immediately upon the opening of the workbook, and I've written Matlab code that automatically opens the Excel workbook. The problem is, when Excel opens, the "Enable or Disable Macros" prompt pops up, and it has to be clicked out of manually in order for the workbook to be opened and the macros to automatically run. The normal way around this is apparently to set the Macro Security level to "Low" which results in the workbook automatically being open with the macros enabled, but due to security settings on my computer I am unable to change the Macro Security level to anything lower than Medium.
In order to programmatically get past the prompt with macros enabled, it occurred to me that all that one would theoretically have to do is press "Tab" to select the "Enable Macros" button, and then "Enter" to get past the prompt, and that this could programmatically be done with the Matlab analog of the VBA "Sendkeys" function. After researching this, I can't find anything in Matlab that replicates the functionality of SendKeys, but it looks like it's actually possible to do in either C or C++, which can then be written into a mex file and executed in Matlab. I'm not really understanding how Sendkeys works in C/C++, though... is it possible to have C/C++ automatically press Tab,Enter in a mex file?
Any help will be greatly appreciated!!
Answer : SendKeys in mex file
SendKeys isn't VBA, it's VBS.
If you need it to work, then write a VBS file with the proper sendkeys stuff in it, save it as a VBS, and then have matlab call that file instead of a C/++ executable.
HTH,
exx
Random Solutions
Continue to next part of script w/o having to close command prompt window
Push not working on iphone with Exchange 2010...
which is the best website to learn stored procedure ??
SSG5 VPN Routing, internal LAN route works, VPN route doesnt.
Crystal Reports Xi - Sorting a CrossTab Report by a Summary Field
Apache - Tomcat TCP Connection problem - CLOSE_WAIT / FIN_WAIT_2
Event ID 5000 error office11shipassert
Google Chart corechart help
Cisco 2950 Vlan for Voice
How do I charge for a job?