Hi Bob-
I finally got to run the Hi Bob macro at home where I have Vista installed.
It ran fine in Excel 2003 with UAC off. With it turned back on the
Application.Sendkeys parts were not executed. Interestingly, if I used
VB
Sendkeys (removing "Application.") they were executed.
I found both versions run in Excel 2007 with UAC on, as you did.
I don't use Sendkeys much but when I do I use the
VB version. Just lazy I
guess.
--
Jim
"Bob Flanagan" wrote in message
. ..
Nick, thanks for the link. It will be helpful. What is strange is that
sendkeys works in Excel 2007 on the same machine, but does not work in
Excel 2003 on it. And there are simple work arounds. So, I doubt that it
was stopped from working due to security reasons. I suspect that
Microsoft screwed up is a more likely explanation. Not that they could do
so.
There are some good reasons to use sendkeys. For example, say that your
last command in a macro is to delete cell entries. If done with vb code,
then undo will not work. If done with sendkeys, undo does work.
Bob
"NickHK" wrote in message
...
Bob,
As Vista is designed to be more secure, some aspects of "easy"
programming
are no longer valid. May depend if you have UAC active or not.
Here a VB thread along similar lines with a couple of solutions/thoughts.
See the link on the last post.
http://groups.google.co.uk/group/mic...fc5864 e1d061
But as suggested, it may be better to try and remove those calls, for
future
compatibility.
NickHK
"Bob Flanagan" wrote in message
...
Nick, my example was just to illustrated a use of a simple sendkeys in
2003
on a Vista platform. Sendkeys (and Application.Sendkeys) is just
ignored
when run by 2003 on Vista - and no error messages occured at all. Which
is
very strange. It makes one wonder what else will not work in 2003 on a
Vista platform, and not give errors......
Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
"NickHK" wrote in message
...
Bob,
What about:
Application.GetOpenFilename
NickHK
"Bob Flanagan" wrote in message
...
Greetings. I just reformatted one of my PCs, installed Windows Vista
and
then Excel 2003 so that I had a clean installation. I found that
Sendkeys
does not work on Excel 2003 on Windows Vista. I recognize that
Sendkeys
should only be used when all else fails, but there are those
situations.
The solution is to do the following: (in this case for File, Open)
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
wshShell.SendKeys "%FO", True
Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel