Hi,
I am working on excel file that enabled VBA Object Model Through SendKeys for all English language users, SendKeys are not working for Users with Office Spanish version. I am hoping if anyone help in translating SendKeys to spanish version? I have placed my code snippets below.
I am working on excel file that enabled VBA Object Model Through SendKeys for all English language users, SendKeys are not working for Users with Office Spanish version. I am hoping if anyone help in translating SendKeys to spanish version? I have placed my code snippets below.
Code:
Public Sub EnableTrustAccess()
Dim i As Integer
Dim strkeys As String
On Error Resume Next
Do While i <= 2 'try to sendkeys 3 times
DoEvents
Sleep 100
DoEvents
If Application.LanguageSettings.LanguageID(msoLanguageIDUI) = 1033 Then 'English Version
strkeys = "%tms%v{ENTER}" 'Enable trust access to vba project object model
Else 'Spanish Version
strkeys = "????" 'enable trust access to vba project object model
End If
Call SendKeys(Trim(strkeys))
DoEvents
Sleep (100)
i = i + 1
Loop
End Sub