Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 10th, 2003, 08:52 PM
Registered User
Join Date: Nov 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel/VBA and hotkeys

I have an Excel/VBA macro in which I want to record the screen using Camtasia Studio's Recorder. You just hit F9 and the Recorder grabs a frame. When I try to do this from the macro (below), the application is activated but nothing happen from the SendKeys command. Any ideas?

AppActivate "Camtasia Recorder"
SendKeys "{F9}", True

Reply With Quote
  #2 (permalink)  
Old September 5th, 2004, 12:32 AM
Registered User
Join Date: Sep 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to veedgo

Sometimes, what I've noticed is that the application needs time to complete it's focus. If the application takes time, the Sendkeys statement could be finishing before the application is ready for it. Since this is asynchronous, you'll need to put a small timer in your code such as For i = 1 to 10000000:Next (the value depends on how fast your computer is, so you'll have to tune this through debugging).

This isn't perfect and it would be better if you had a way to return a state from the application opening up before executing your Sendkeys statement, but I am still learning how to do that.

Reply With Quote
  #3 (permalink)  
Old September 9th, 2004, 07:24 AM
Authorized User
Join Date: Aug 2004
Location: , , .
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts

This is an alternative although we can only go down to 1 second delay :-
Application.Wait Now + TimeValue("00:00:01")
Regards BrianB
Most problems occur from starting at the wrong place.
Use a cup of coffee to make Windows run faster.
It is easy until you know how.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hotkeys in macros HaileyJ Access 2 September 10th, 2007 03:13 AM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
is it possible to have system level hotkeys in C# stygen .NET Framework 1.x 0 March 12th, 2007 11:58 PM
Converting excel data to Access using excel VBA ShaileshShinde VB Databases Basics 1 April 26th, 2006 07:57 AM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM

All times are GMT -4. The time now is 03:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.