+ Reply to Thread
Results 1 to 4 of 4

How to tell user action type independent of language

  1. #1
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    How to tell user action type independent of language

    Hey all,

    i need to execute some code based on the last action the user took.
    For example:
    if last_action = "Table Resize" then do stuff.

    after some googling around i got this
    Application.CommandBars("Standard").Controls(14).List(1) which gives me the last_action from the undo list which works fine but is language depended!

    Any ideas how take the action type which would not be languange depended?
    something like
    if last_action_type = xlTableResize then do stuff.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: How to tell user action type independent of language

    what do you mean by language depended? I don't understand that. are you saying that your application.commandbars method doesn't work if written in different languages, or if the user is using the problem in another country?

    furthermore, can you clarify what you mean regarding your question about using the enumeration constant preceeded by the xl standard naming convention? e.g. - your question about using xlTableResize?

  3. #3
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: How to tell user action type independent of language

    hey,

    so if my office ui language is english then application.commandbar will return "Table Resize" if the user resized a table for example. but if office ui language is say greek, it will return the greek translation of "Table Resize" and the code will not work as the string is different now. this is why im looking something of a constant/enumeration as this would be language independed for more elegant code. does this make sence?

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: How to tell user action type independent of language

    yes it makes sense. and I'm not sure if there are language translation libraries available to you if you are using such an outdated language like VBA. but if you were using, say for instance, Python, you could obviously do it very easily. take a look at this page, which lists all of the resources that come with the local installation of Python 3.x.x:

    https://www.adamevanovich.com/python...urce-list-375/

    when you go to that page, search . it for the string lang. you will see some libraries there that are classified as ""models"". not sure what those are, but I know for a fact that Python has resources to translate languages. That's just an example for you. I'm pretty sure if you googled what you are looking for and whether VBA has it as a feature, you won't find anything. because your question is not a simple one.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 10-31-2019, 11:02 PM
  2. [SOLVED] loop until user performs action
    By joseph.davidow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2016, 03:50 AM
  3. Detect if user hits cancel from user input type box
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 11:42 AM
  4. Message Box - Wait for action user...
    By beelener in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2010, 07:38 AM
  5. Message box without required user action?
    By huzkerpride in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2008, 04:16 AM
  6. [SOLVED] Type Mismatch: array or user defined type expected
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 10:45 AM
  7. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1