I have an xlsm workbook that gives a "Subscript out of range" error in response to ThisWorkbook.Styles("Percent").Value on one system but not on another. On the system that throws the error the style named "Percent" seems to have been replaced by one called "Per cent". I suspect this has its origins in language settings differing on the two computers. The working system is set to English (UK) throughout but I'm unable to establish which setting or combination of settings would result in Excel renaming the style internally without warning. Changing some of the settings to English (United States) seems to be non-trivial and I'm scared to mess up my computer trying to do so. Can anyone enlighten me as to what is going on here?
What setting is causing Excel VBA to change the named Range.Style "Percent" to "Per cent"?
375 Views Asked by Ian Brown At
1
There are 1 best solutions below
Related Questions in EXCEL
- Power Query / M Code, extract a list of tables into one main table, some column headers same but some different and in different order (and in row 2)
- Is there a way to validate the cell format (from excel) to fetch the symbol from it (in Java)?
- Excel - Visual Basic, macro with autofill "1"
- Getting Run-time error '13': Type Mismatch using .Find
- Getting website metadata (Excel VBA/Python)
- Excel Code Editor doesn't work (blank window)
- How to find out how many of each 2, 3 and 4 required to fit in 100 using excel?
- How would I apply a rather complex summation formula like this in Excel?
- Removing a Button from Customized Excel Ribbon
- Excel - Update Item Description Based on Accessories Ordered with It
- select duplicates from data based on another column
- How to use VBA to bold just some text
- VBA Code to filter and get values from csv to excel worksheet
- Look up max alpha numeric value
- Azure Batch for Excel VBA
Related Questions in VBA
- Toggle "conversation view" in Outlook with VBA
- VBA query - sort text in alphabetical order in Word
- Excel - Visual Basic, macro with autofill "1"
- Getting Run-time error '13': Type Mismatch using .Find
- Getting website metadata (Excel VBA/Python)
- How to use VBA to bold just some text
- VBA Code to filter and get values from csv to excel worksheet
- Azure Batch for Excel VBA
- How can i printpreview multiple excel sheets, with the names of the sheets located in a range?
- Comparison the data of two row and unique number highlight and show below of it
- Is there a way to pass Today's date as a command line argument to Excel from a Windows Task Scheduler Job
- Xero Upload Invoice file using API
- Visual Basic For Application Related Question
- Trying to give color to column field headers in pivot table with vba
- General error handler: If any error in UserForm other than msgBox: Err.Description
Related Questions in REGIONAL-SETTINGS
- Show iOS numeric keyboard in input text
- Why can I format my dates by regional settings in Chrome but not Firefox in my Javascript application using toLocaleDateString()?
- VBA text to column on a column with date
- Adding time to VBA macro returns different date format despite range formatting
- Can Wordpress Multisite share pages between each other?
- Translating string formula to cell formula in regional language changes relative reference
- Save string with a Long date to a field with datevalue(string)
- Power BI changing decimal separator from comma to dot
- Visual Studio build started at message reports time in US AM/PM. How do I get it into 24 hour clock format?
- ArcGIS Field with greek characters lost on export
- Which NumberStyles to use in order to have the right number conversion?
- Detect if the client installing the software is located in US or other countries
- Java doesn't recognize Unicode character in path on Windows 11
- IsDate Check allowing different local date formats
- Value VBA read from file different as declared value
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
After further investigation, I now have an answer - an unexpected one.
My main machine has all Windows settings set to English (United Kingdom). On my start menu, under Microsoft Office Tools, there’s an Office Language Preferences application where the preferred Office display language is set to Match Microsoft Windows [English]. Excel shows a style named "Percent" with these settings.
On a test system with the same initial settings I added the Office display language called English (United Kingdom). With the preferred Office display language set to Match Microsoft Windows [English (United Kingdom)] Excel shows a style named "Per cent" and no style named "Percent". I had to add an Office display language called English (United States) and make it the preference in order to see a style named "Percent" again.
You couldn't make it up. "Match Microsoft Windows [English]" is VERY misleading on a system where Windows is set to English (United Kingdom) across the board.