Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2003, 08:52 PM
Registered User
 
Join Date: Nov 2003
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

 
Old September 5th, 2004, 12:32 AM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to veedgo
Default

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.

 
Old September 9th, 2004, 07:24 AM
Authorized User
 
Join Date: Aug 2004
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is an alternative although we can only go down to 1 second delay :-
Code:
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.





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





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