Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Excel 2003, Vista, and Sendkeys

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Excel 2003, Vista, and Sendkeys

Hi Bob:

This is a little disturbing. If you run:

Sub test()
Range("A1").Select
Application.SendKeys "{F2}"
Application.SendKeys "Hi Bob"
Application.SendKeys "{ENTER}"
End Sub


would you get an error mesage ?
--
Gary''s Student
gsnu200711

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Excel 2003, Vista, and Sendkeys

I just ran the test on sending "hi bob" (that seemed the best to me <g).
It does not work in Excel 2003 on a clean vista install. It does work on
Excel 2007.

Bob

"Gary''s Student" wrote in message
...
Hi Bob:

This is a little disturbing. If you run:

Sub test()
Range("A1").Select
Application.SendKeys "{F2}"
Application.SendKeys "Hi Bob"
Application.SendKeys "{ENTER}"
End Sub


would you get an error mesage ?
--
Gary''s Student
gsnu200711



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel 2003, Vista, and Sendkeys

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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Excel 2003, Vista, and Sendkeys

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









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel 2003, Vista, and Sendkeys

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









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Excel 2003, Vista, and Sendkeys

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











  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel 2003, Vista, and Sendkeys

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












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Violation when using Excel 2003 on Vista David Bryant Excel Discussion (Misc queries) 1 April 27th 08 06:18 PM
Excel 2003 on Windows Vista Steve Excel Discussion (Misc queries) 0 August 2nd 07 03:50 PM
Excel 2003 Running in Vista JAD Excel Discussion (Misc queries) 1 July 11th 07 05:25 PM
Excel 2003 Vista fax/print problems G4E Excel Discussion (Misc queries) 0 March 19th 07 05:24 PM
What are the difference between 2000, 2003 and Vista for Excel Use prakash New Users to Excel 2 December 1st 06 07:36 PM


All times are GMT +1. The time now is 11:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"