Enable Trust Access to VBA Object Model through SendKeys Excel Spanish version

ABCWork

New Member
Joined
Jun 18, 2017
Messages
4
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.


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
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule #13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
I am marking this question as solved as I donot want to get any cross-posted response again, kudos to alan and joe.
 
Upvote 0
I was just alerting you to our policy.

If you are sure to mention any threads that you may Cross-Post in the future, and provide links to them, you won't get those kind of responses.;)

Thanks
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,312
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top