Opening VBA code exchanges characters - excel

I have a problem with some code I have written in an English version of Excel 2011 for mac. When I open the workbook in Excel 2013 in Swedish certain Swedish letters in the code get converted to other characters, rendering the code useless. In other words, I have used special characters to define variables (I know, not good practice) and as conditionals (If x = 'Ombeställning' for example).
Is there an easy way to force the compiler to read my code as UTF-8? I'm on a tight deadline and I really don't feel like retracting all my variable declarations and subsequently changing my defined range names. If there is no other way, please tell me so I can get on changing the code.
Lastly, opening the workbook in Excel 2013 changed some of the row widths/heights, is this avoidable? I've spent a lot of time on formatting and it simply doesn't look professional when parts of the text are cut off etc.
EDIT: I forgot to mention I am opening 'Excel 2013 ' on a PC, which is probably the culprit regarding character encoding rather than the Excel version language.

Related

changing comma to period using conditional formatting (excel2016)

I'm running into an issue.
I have created a excel sheet to aid in logging hours.
But excel uses a comma as a decimal separator, But the oracle system where it is pasted in uses a comma as thousands separator and a period as decimal separator.
The sheet needs to be idiot proof and has a set lay-out so oracle recognizes it properly.
So working with formula's isn't a real option.
Also changing de decimal separator in excel from comma to period will lead to problems in other applications.
This leaves me with conditional formatting (as far as I know)
I'm not familiar with macro's unfortunately, but it's never to late to learn.
For the sake of getting your help the protection in the first sheet is turned off:
Link to File
Hope you guys can help me out.
How it is
what it needs to become

An issue when generating text with national symbols using VBA in Excel 2019

I am using some VBA add-in to generate text from numbers, that text contains national Lithuanian, German or any other national symbols. This used to work fine with the previous versions of Excel so far, but the system has now been upgraded from scratch and it does not seem to work well with Excel 2019.
In VBA, the code looks fine and you can see the national symbols like "š" (well after setting the locale to Lithuanian, before they were appearing as multiple strange symbols):
, however when in excel the functional is called, the output has just � instead of any national symbol. All of the national symbols are marked with the same � sign in Excel 2019. But you can write manually national symbols just fine in Excel, just what comes out of VBA is garbage missing those symbols.
It looks like this in a cell:
Trys �imtai �, 00 ct
Does anybody know how to fix this and make them appear normal with how they are visible within the code?
A few other observations are that when copying and pasting the code from the VBA Editor to Notepad++ the national symbols get lost as well and they appear as different strange symbols. Also when trying to use the find function in the VBA Editor window to find anything with the national symbols - no results are ever found as long as you don't remove the national symbols...
In my understanding, support for "international" ("non-Latin") characters is determined by your Windows Regional Settings, not by Excel or by the VBA IDE.
Since I'm in Canada I can't easily test on my end to verify this, but interestingly, your example character of š displays the opposite of how it shows for you: it renders properly on the worksheet but as gibberish in VBA.
Incidentally I determined the Unicode id number for š (Unicode 353) by pasting the symbol into cell A1 and then in another cell using formula =UNICODE(A1). The opposite function (to return a character from it's code) is UNICHAR. The VBA equivalents are AscW and ChrW.
I was aware that the VBA IDE can be made to display "international" characters by adjusting Windows Regional Settings (like discussed here), but I didn't realize any setup would make them not render on the spreadsheet since for me, most Unicode characters display properly on a worksheet.
I assume the characters don't work for you in other applications besides Excel. If that's not the case, and this problem is specific to Excel (or if you can't otherwise get it figured out by adjusting Windows Regional Settings), then I'd suggest contacting Microsoft Tech Support.
More information is here or here or in this search might also be helpful.
hi i had same problem in latvian
just uncheck utf - 8 beta in regional language settings for non unicode
enter image description here

Name of Excel formula in different languages in xlsx format

I generated Excel file in my application in xlsx format. Unfortunately if I use English name of the function and my Excel is not set to English then Excel identifies it as bad function name. Simillar situation does not happen in xls format.
Is it any way to avoid this problem?
Configuration of Excel itself is not acceptable solution as client should not be forced to make changes in his environment.
Thanks in advance for any help
Excel has its own way for translating the formulas from every language to English. You should not take care of that, it does it quite well. Thus a file in Spanish Excel can be read in French Excel without further adjustments.
E.g., see the German formula "SUMME" in F1. It is translated by excel to "SUM", when you ask about it -> see the immediate window on the right.
The only thing you should avoid is formula like this:
activecell.FormulaR1C1Local= "=SUMME(Z(8)S(-2):Z(9)S(-2))", because it takes the local formula as a string and Excel cannot find a way to translate "SUMME" to "SUM".

Excel macros handling numeric values differently on various computers

Recently I had to create macro for some calculation in a spreadsheet. Macro worked fine on some computers, but it failed on other computer, which I don't hace full time access to. All of them had the same version of Windows and Excel.
After some analysis I recognised, that problem occured in following cases:
My computer accepted cell values as numeric, when their decimal
points where coma separeted, other didn't. All of them had dot as
decimal separator set in windows region settings.
My computer accepted cell values with spaces inside (f.e.: '2 134 432,32') as numeric, other didn't.
I ended up writing workarounds that handled those cases, BUT! I need to know where this problem come from and how to avoid them in future. DO you have any experience and can share it with me?

Why does the string format returned by Range.Address(external:=True) change?

I have some VBA code that obtains Excel cell references as a string using
rng.Address(External:=True, ReferenceStyle:=xlR1C1)
The VBA code talks to a COM server, which needs to know what the string format is.
Unfortunately, the format seems to switch (at random?) between two cases. I don't know what is causing VBA to make this change.
The two formats are
'[book]sheet'!R1C1
[book]sheet!R1C1
That is, sometimes the book-and-sheet part has enclosing single quotes but sometimes it doesn't!
I can see these format changes within the VBA debug window by directly printing the address string.
I have experienced this on Office 2007 and 2010.

Resources