After printing through ActiveSheet.PrintPreview the separator changes. (bug)

First of all in my Regional and language options Decimal symbol is comma "," and Digit grouping symbol is dot ".". If Decimal symbol is dot "." and grouping symbol space " " then it's okay. But i must use: Decimal symbol comma "," and Digit grouping symbol dot ".". I will try to reproduce steps how to find this bug, but we need to apply Regional and language settings before we begin. After that:

1. Open new workbook, select some cell and press few times "Del" button on the right side of keyboard where are numbers(if we use main button separator near the letter keyboard it's ok). As result we have to see our comma in cell.


2. Open VBA editor, and create new module, write this code and of course launch this sub:

Sub Example
   ActiveSheet.PrintPreview
End Sub

3. Now we see
PrintPreview with our written comma, so press Print or Ctrl+P, and wait until it will send to printer and back to our Sheet. By the way Printer can be offline it's no matter.

4. Select other cell and press "Del" button on the right side of keyboard where are numbers. And as you see now our "Del" writing not comma but dot... so after printing our separator changed.

5. If we will launch our sub example again, our separator will change back from dot to comma.. and so on.

I have tried:


1 . Excel options -> Advanced -> "Use System separators" Uncheck(because as default it's checked) and after with Checked.
2. Tried on other OS like Windows XP, VISTA, Win7 - all updates (3 different PC)
3. Even in other Excel versions 2003, 2007, 2010 - all updates (3 different PC)

4. With other printers Cannon, Samsung, HP..

Maybe I'm doing something wrong? Any ideas?

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

I can reproduce this behavior in Excel 2003. It's a strange bug - the decimal separator hasn't really changed, for 3,45 is still recognized as a number while 3.45 is interpreted as text. But the action of the Del key has changed.
---
Best wishes, HansV
https://www.eileenslounge.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Worst case of scenario if using formulas... new values with dot turning all formulas to #VALUE. So after printing i need to restart workbook or print again. How to report such bug?

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

So anyone found solution? It's microsoft excel Bug..  i can make video to show..

Open Excel write 5,5 with right keyboard keys and comma is entered with "Del" key. After runing

Sub Example
   ActiveSheet.PrintPreview
End Sub


And presing Print, "Del" button separator changes to DOT "." ..

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I found a solution.

If i use:

Sub ine()
ActiveSheet.PrintOut Preview:=True
End Sub

My "DEL" key on number keyboard change separator. But if i try:

Sub inee()
ExecuteExcel4Macro "PRINT(1,,,1,,TRUE,,,,,,2,,,TRUE,,FALSE)"
End Sub

This works fine after printing!

Now left to find what parameters need to pass. Maybe this will help somebody.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Please, help me... save me from this Microsoft BUG

Comma decimal separator turns into dot after Print code?

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi,

I can confirm this strange behaviour also now in 2017 with Windows 8.1 and Excel 2013.

When printing in Excel through the print preview, the function of the "DEL" key in the number block of the Keyboard is changed from "," to "." and back each time you print...

Regional settings in Windows or selection of the automatic or manual decimal and thousands separators in Eyxcel does not change anything in this behaviour. (I am using german region and language settings)

Has anybody found a workaround yet?

Note: application.decimalseparator is still set to "," - only the key sent by the "DEL" key is changed!

Greetings,

Oliver

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I had the same problem and have a very simple solution:

Instead of 

ActiveWindow.SelectedSheets.PrintPreview (1)

use

Application.CommandBars.ExecuteMso "FilePrintPreview"

Greetings,

Heinz

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

BRAVO   BRAVO BRAVO   BRAVO  BRAVO!!!!

THANK YOUUUUUU!!!!!

Application.CommandBars.ExecuteMso "FilePrintPreview"

Greetings from Bosnia&Herzegovina!

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hello Heinz,

Thanks for the VERY helpful reply! The tweak works fine as far as I could check so far.

Actually, I had found a workaround that worked for me as well since I have all the page setup etc. prepared and just need a printout "as is".

I just used the direct PDF print function which also worked fine. Of course it took me some more VBA to get a saveas filename etc, but I can live with it.

ThisWorkbook.Worksheets(Sheet).ExportAsFixedFormat Type:=xlTypePDF, Filename:=DatName, _
                    quality:=xlQualityStandard, includedocproperties:=True, ignoreprintareas:=False, openafterpublish:=True

I also tried the suggestion with the

ExecuteExcel4Macro "PRINT(1,,,1,,TRUE,,,,,,2,,,TRUE,,FALSE)"

command, but I have not managed to have the user select a printer. The command like it is will print on the default system printer. But I have to admit that I did not try very hard - somewhere I found a Version of the Parameters where the printer was listed as one Parameter - you could probably get the printer with the standard-Dialog from the user and insert the printer string in the command. But who knows how Long those commands will actually still be supported!?

But it is really good to know there is a solution if I do need the page Setup.

Just to explain why I am actually using the printpreview instead of having the user print manually - I have a rather big Excel sheet with a lot of macros and active-X elements on some sheets. For some strange reason, my Excel 2013 started crashing after inserting some more active-X elements whenever the user wanted to enter the page setup or tried to print via "File"-->"Print".

Greetings from Stade, GER

Oliver

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hello again...

I did not think to the end...

Is there a possibility to start the printpreview with an adjusted Version of

Application.CommandBars.ExecuteMso "FilePrintPreview"

for a sheet that is not the currently activated one?

Greets,

Oliver

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated October 5, 2021 Views 709 Applies to: