PeteWright
Active Member
- Joined
- Dec 20, 2020
- Messages
- 483
- Office Version
- 365
- Platform
- Windows
- Mobile
Hello everybody,
as you can see in the topic title I get issues with the decimal separator on different computers.
The current situation:
I write and test VBA code on my computers (home desktop and laptop / work laptop) which all have Excel 365 (Personal / Business) English installed.
The task:
My VBA Excel-files should work on my colleagues computers running Windows/Excel German
The problem:
Different language settings use different decimal separators and although Excel formulas should be and in fact are translated from EN to DE and back, the VBA code isn't.
The challenge:
Write code that works on any machine using MS Excel
This is just an example:
The same VBA code results in different output on my computers.
On my home computer running Windows 10 Pro x64 English with MSO 365 Personal English I get "0.75"
On my work laptop running Windows 10 Enterprise x64 German with MSO 365 Business English I get "75"
Well, there is nothing more to say, I need some help in writing my code to work everywhere.
Any help or advice highly appreciated.
Kind regards
Pete
as you can see in the topic title I get issues with the decimal separator on different computers.
The current situation:
I write and test VBA code on my computers (home desktop and laptop / work laptop) which all have Excel 365 (Personal / Business) English installed.
The task:
My VBA Excel-files should work on my colleagues computers running Windows/Excel German
The problem:
Different language settings use different decimal separators and although Excel formulas should be and in fact are translated from EN to DE and back, the VBA code isn't.
The challenge:
Write code that works on any machine using MS Excel
This is just an example:
VBA Code:
Sub TEST()
Dim str As String
Dim dbl As Double
Dim tmp As Variant
str = "0.75"
tmp = CDbl(str)
MsgBox tmp
End Sub
The same VBA code results in different output on my computers.
On my home computer running Windows 10 Pro x64 English with MSO 365 Personal English I get "0.75"
On my work laptop running Windows 10 Enterprise x64 German with MSO 365 Business English I get "75"
Well, there is nothing more to say, I need some help in writing my code to work everywhere.
Any help or advice highly appreciated.
Kind regards
Pete