473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

sendkeys issues

Mague
137 100+
hey,

Ive got a problem with sendkeys every time i use the sendkeys funcion it say that is a type and not an expression (Expression is for eg. 1+5 or 5+6). But i never have had it an expression some example which dnt work are

Sendkeys("Hey")
sendkeys(string)
Sendkeys(function)

all of these return with the same errow


ty for reading
Mague
May 27 '07 #1
6 2375
Killer42
8,435 Expert 8TB
hey,

Ive got a problem with sendkeys every time i use the sendkeys funcion it say that is a type and not an expression (Expression is for eg. 1+5 or 5+6). But i never have had it an expression some example which dnt work are

Sendkeys("Hey")
sendkeys(string)
Sendkeys(function)

all of these return with the same errow
First of all, pretty much any value you deal with can be considered an "expression".

Secondly, please give us the specific details of the error message. Also, what version of VB are you using?

Certainly I would expect VB to spit the dummy if you put the word 'string' in there, since that is a reserved word. It could also explain the error message referring to a "type", since that's what String is. Likewise for 'function'. Don't know why it wouldn't like "Hey". Are you sure it's always the same error?
May 28 '07 #2
Mague
137 100+
Yes i am sure! also i didnt mean i write string i mean i put a var which is a string likewise with function also how can u tell wat version u use? because im lke a 13 nd jst choose Microsoft Visual Basic Expres Edition
May 28 '07 #3
Killer42
8,435 Expert 8TB
Yes i am sure! also i didnt mean i write string i mean i put a var which is a string likewise with function also how can u tell wat version u use? because im lke a 13 nd jst choose Microsoft Visual Basic Expres Edition
Have you just downloaded the VB Express Edition? In that case, that would be VB 2005. Unfortunately I'm not familiar with that, as I use a much older version (VB6). I plan to learn the later one, but it's not easy to find the time.

Hopefully someone here who is familiar with your version will chip in and help, but in the meantime I'd recommend you check the documentation for how to use SendKeys correctly.

You can also use the Search box up the top to see what else has been discussed here. I just had a quick look and found this, which may indicate something you've missed...

'if it is open, send the CTRL O command to choose a file
My.Computer.Keyboard.SendKeys("^o")
May 28 '07 #4
Mague
137 100+
Hey dw i found out a new way to type

if for some reason ur intrested its
sendkeys.send("text")
and that wil work jst as well

Mague

ps thanks heaps killer
May 28 '07 #5
Killer42
8,435 Expert 8TB
Cool!

Glad you got it working.

I think in our Articles section we need to set up something on the differences between the VB versions, to cover things like this.
May 28 '07 #6
Mague
137 100+
thanks and that will be great
May 28 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: David Kanter | last post by:
Hello, I have a question regarding SendKeys(). I am working on a small VB .Net script that manipulates/automates programs through SendKeys(). Unfortunately, I have run into several problems. ...
0
by: Mr. Bungle | last post by:
I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results) Private Sub...
2
by: RBohannon | last post by:
I need to create a report in MS Word populated with data from A2K. I have been asked to create the report in Word so that parts of it can be edited as necessary later. The data in the report are...
1
by: George | last post by:
Every time I used the Sendkeys command in my application the "Numlock" turned off and I couldn't use the keypad to hit numbers...... The old code was: Private Sub Command1_Click() SendKeys...
1
by: Bryan | last post by:
I am writing a C# Windows App that updates out Excel reports' modules. The app is complete, but has a problem. The only way MS allows you to unprotect the VBA code in Excel is to do it by hand or...
1
by: Manoj Nair | last post by:
Hi, The problem : Have a system tray application.This has a menu item 'Exit'. On click of this a differnt application with a UI which runs in the background should close. The other application...
5
by: Pete | last post by:
I'm trying to use SendKeys to send a 'close' key sequence to an application popup. Unfortunately, I'm running into the classic timing issues with SendKeys at it sometimes hits the wrong app (even...
6
by: Michael Maes | last post by:
Hello, I'm invoking successive SendKeys.SendWait("{BACKSPACE}") SendKeys.SendWait("{DELETE}") in a loop. The issue is that it causes a Beep on every Pass. Setting the 'Handled = True' on...
0
by: dtshedd | last post by:
I have a database with hundreds of embedded photos (Microsoft Photo 3.0) Many are larger than 1 MB. I tried Stephen Lebans macro but it did not work probably for the aforementioned reasons Now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.