Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-07-2021, 01:31 AM
rgros rgros is offline install language and macro language Windows 10 install language and macro language Office 2019
Novice
install language and macro language
 
Join Date: Jan 2021
Posts: 8
rgros is on a distinguished road
Default install language and macro language

I have a inhereted a macro that inserts a table if it is needed and checks after doing so if the table style is OK.
It fails sometimes, namely when the table is inserted. It appears that an error is raised on these lines:
Code:
        With Selection.Tables(1)
            If .style <> "Tabelraster" Then
                .style = "Tabelraster"
            End If
        End With
This used to work, but somehow the word install now is an english install, it used to be a dutch install, in which the style name for 'Table Grid' is 'Tabelraster'. The english install raises an error "Can't apply style"; changing 'Tabelraster' to 'Table Grid' in the macro makes it work again.
I need to fix this situation and I want to understand what option I have to repair this.
  • is a dutch install absolutely needed when the style names are dutch?
  • can the macro detect the language of the install and behave accordingly?
  • is there a way to write the macro in a way that is install language independant?
  • do I need to scan all macro files for dutch style names and translate them to english?
thanks for any insights about this!


Ruud



I have changed the above code to
Code:
        With Selection.Tables(1)
            Dim insLan
            insLan = Application.LanguageSettings.LanguageID(msoLanguageIDUI)
            If .style <> "Tabelraster" And .style <> "Table Grid" Then
                If (insLan = 1033) Then
                    ' English
                    .style = "Table Grid"
                else
                    ' Dutch
                    .style = "Tabelraster"
                End If
            End If
        End With
...which seems to work, but it feels lik the wrong way to go. What would be the best practice?
Reply With Quote
 

Tags
language, style language

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having Difficulty Changing the Default Language and Spell Check Language JimG35 PowerPoint 0 10-30-2020 04:41 PM
install language and macro language installation of a language pack in Greek language for MS office 2016 professional plus/prob alsw Office 3 02-26-2018 08:49 PM
Macro to change language and untick 'do not check spelling' William E PowerPoint 2 05-13-2017 01:47 PM
install language and macro language Word macro - remove shading from active para. and assign language to it, keep text cursor position dejanm83 Word VBA 3 03-19-2017 02:36 PM
install new interface language shmu Office 4 09-21-2014 02:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft