jagrenet
Board Regular
- Joined
- Feb 23, 2022
- Messages
- 81
- Office Version
- 365
- 2013
- 2011
- 2010
- Platform
- Windows
Hello,
I am attempting to use SendKeys in vba to "send" Enter to a Word doc. I keep getting a Compile error even after the variable is declared.
This code already lives inside a working Sub Routine, just want to "add" this function.
Dim SndEnter As Variant
Set SndEnter = Application.SendKeys("{ENTER}", True)
With
(working Application.Selection code
SndEnter
End With
"Compile Error - Expected Function or variable "
Not sure why this error is coming up.
Any ideas ??
Thanks in advance
I am attempting to use SendKeys in vba to "send" Enter to a Word doc. I keep getting a Compile error even after the variable is declared.
This code already lives inside a working Sub Routine, just want to "add" this function.
Dim SndEnter As Variant
Set SndEnter = Application.SendKeys("{ENTER}", True)
With
(working Application.Selection code
SndEnter
End With
"Compile Error - Expected Function or variable "
Not sure why this error is coming up.
Any ideas ??
Thanks in advance