SENDKEYS and brackets

Z

Zakynthos

I'm using sendkeys (yes, I know not always reliable...) to send data to a
program which admits brackets of any description in headings and names and
when typed or copied from elsewhere and pasted into a data field will be
readily accepted.

However, when exactly the same data is sent via sendkeys all is exported but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them into a data
field?

Many thanks.
 
G

Gary''s Student

Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
 
R

Rick Rothstein

I'm not sure what the difference is between your system and mine (I'm using
XL2003 fully updated), but I cannot get your first macro to print
anything... the cell activates, but nothing is entered into the cell.

--
Rick (MVP - Excel)


Gary''s Student said:
Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
--
Gary''s Student - gsnu200813


Zakynthos said:
I'm using sendkeys (yes, I know not always reliable...) to send data to a
program which admits brackets of any description in headings and names
and
when typed or copied from elsewhere and pasted into a data field will be
readily accepted.

However, when exactly the same data is sent via sendkeys all is exported
but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them into a
data
field?

Many thanks.
 
G

Gary''s Student

Are you using Vista??
--
Gary''s Student - gsnu200813


Rick Rothstein said:
I'm not sure what the difference is between your system and mine (I'm using
XL2003 fully updated), but I cannot get your first macro to print
anything... the cell activates, but nothing is entered into the cell.

--
Rick (MVP - Excel)


Gary''s Student said:
Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
--
Gary''s Student - gsnu200813


Zakynthos said:
I'm using sendkeys (yes, I know not always reliable...) to send data to a
program which admits brackets of any description in headings and names
and
when typed or copied from elsewhere and pasted into a data field will be
readily accepted.

However, when exactly the same data is sent via sendkeys all is exported
but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them into a
data
field?

Many thanks.
 
R

Rick Rothstein

Yes. I guess Vista is protecting me from myself by not allowing SendKeys?

--
Rick (MVP - Excel)


Gary''s Student said:
Are you using Vista??
--
Gary''s Student - gsnu200813


Rick Rothstein said:
I'm not sure what the difference is between your system and mine (I'm
using
XL2003 fully updated), but I cannot get your first macro to print
anything... the cell activates, but nothing is entered into the cell.

--
Rick (MVP - Excel)


message
Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
--
Gary''s Student - gsnu200813


:

I'm using sendkeys (yes, I know not always reliable...) to send data
to a
program which admits brackets of any description in headings and names
and
when typed or copied from elsewhere and pasted into a data field will
be
readily accepted.

However, when exactly the same data is sent via sendkeys all is
exported
but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them into a
data
field?

Many thanks.
 
G

Gary''s Student

See:

http://groups.google.com/group/micr...ng/search?q=sendkeys+vista&start=0&scoring=d&

But I thought this problem had been fixed?
--
Gary''s Student - gsnu200813


Rick Rothstein said:
Yes. I guess Vista is protecting me from myself by not allowing SendKeys?

--
Rick (MVP - Excel)


Gary''s Student said:
Are you using Vista??
--
Gary''s Student - gsnu200813


Rick Rothstein said:
I'm not sure what the difference is between your system and mine (I'm
using
XL2003 fully updated), but I cannot get your first macro to print
anything... the cell activates, but nothing is entered into the cell.

--
Rick (MVP - Excel)


message
Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
--
Gary''s Student - gsnu200813


:

I'm using sendkeys (yes, I know not always reliable...) to send data
to a
program which admits brackets of any description in headings and names
and
when typed or copied from elsewhere and pasted into a data field will
be
readily accepted.

However, when exactly the same data is sent via sendkeys all is
exported
but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them into a
data
field?

Many thanks.
 
R

Rick Rothstein

My Vista and my Office installations are completely update; so either they
didn't fix it yet, or they did fix it, but then broke it again with a newer
update.

--
Rick (MVP - Excel)


Gary''s Student said:
See:

http://groups.google.com/group/micr...ng/search?q=sendkeys+vista&start=0&scoring=d&

But I thought this problem had been fixed?
--
Gary''s Student - gsnu200813


Rick Rothstein said:
Yes. I guess Vista is protecting me from myself by not allowing SendKeys?

--
Rick (MVP - Excel)


message
Are you using Vista??
--
Gary''s Student - gsnu200813


:

I'm not sure what the difference is between your system and mine (I'm
using
XL2003 fully updated), but I cannot get your first macro to print
anything... the cell activates, but nothing is entered into the cell.

--
Rick (MVP - Excel)


message
Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
--
Gary''s Student - gsnu200813


:

I'm using sendkeys (yes, I know not always reliable...) to send
data
to a
program which admits brackets of any description in headings and
names
and
when typed or copied from elsewhere and pasted into a data field
will
be
readily accepted.

However, when exactly the same data is sent via sendkeys all is
exported
but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them
into a
data
field?

Many thanks.
 
J

Jim Rech

This is how you send a bracket:

Application.SendKeys "{{}"

--
Jim
Gary''s Student said:
Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
--
Gary''s Student - gsnu200813


Zakynthos said:
I'm using sendkeys (yes, I know not always reliable...) to send data to a
program which admits brackets of any description in headings and names
and
when typed or copied from elsewhere and pasted into a data field will be
readily accepted.

However, when exactly the same data is sent via sendkeys all is exported
but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them into a
data
field?

Many thanks.
 
G

Gary''s Student

Thanks!!
--
Gary''s Student - gsnu200813


Jim Rech said:
This is how you send a bracket:

Application.SendKeys "{{}"

--
Jim
Gary''s Student said:
Your question is a poster child for why people don't like SendKeys.

Brackets and braces {}[]

are tough to "send"

For example:

Sub sendbrackets()
Dim s As String
s = Chr(65)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

will send an upper case A, but:

Sub sendbrackets()
Dim s As String
s = Chr(123)
Cells(1, 1).Select
Application.SendKeys "{F2}"
Application.SendKeys s
Application.SendKeys "{ENTER}"
DoEvents
End Sub

fails totallly!
--
Gary''s Student - gsnu200813


Zakynthos said:
I'm using sendkeys (yes, I know not always reliable...) to send data to a
program which admits brackets of any description in headings and names
and
when typed or copied from elsewhere and pasted into a data field will be
readily accepted.

However, when exactly the same data is sent via sendkeys all is exported
but
the brackets are removed.

Why is this? Can I do anything to overrise this and input them into a
data
field?

Many thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top