W. Baumann
New Member
- Joined
- May 12, 2002
- Messages
- 4
Excel Automation Problem
(Excel 2000, Automation from Access 2000, Windows 2000 Professional)
Via Automation I format column X as following:
...
objActiveWkb.Worksheets(1).Range("X:X").Select
objXL.Application.Selection.NumberFormat = "#,##0.00"
objXL.Application.Selection.HorizontalAlignment = xlRight
...
Adjusting the horizontal alignment worked fine.
Setting the thousand separator does not work,
neither does the decimal separator completely.
The result looks like:
Saldo-EUR
-224107,39
-14243,97
-13030,46
-3228,9
-45136,95
-3648,51
-4971,6
-3404,26
...
Note the missing thousand separators ("." in some parts of Europe).
Note the missing "0" in eg -3228,9 (should be: -3228,90).
Manually checking the format within Excel shows that
setting the format did happen, but Excel fails to display
the new format.
Exactly the same lines of code worked in other instances.
Pressing "F2" and then "Enter" causes the cell to be displayed
correctly!
I would be very grateful for any suggestions.
Thanks in advance, Wilfried Baumann
(Excel 2000, Automation from Access 2000, Windows 2000 Professional)
Via Automation I format column X as following:
...
objActiveWkb.Worksheets(1).Range("X:X").Select
objXL.Application.Selection.NumberFormat = "#,##0.00"
objXL.Application.Selection.HorizontalAlignment = xlRight
...
Adjusting the horizontal alignment worked fine.
Setting the thousand separator does not work,
neither does the decimal separator completely.
The result looks like:
Saldo-EUR
-224107,39
-14243,97
-13030,46
-3228,9
-45136,95
-3648,51
-4971,6
-3404,26
...
Note the missing thousand separators ("." in some parts of Europe).
Note the missing "0" in eg -3228,9 (should be: -3228,90).
Manually checking the format within Excel shows that
setting the format did happen, but Excel fails to display
the new format.
Exactly the same lines of code worked in other instances.
Pressing "F2" and then "Enter" causes the cell to be displayed
correctly!
I would be very grateful for any suggestions.
Thanks in advance, Wilfried Baumann