View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] olivier.sanzot@gmail.com is offline
external usenet poster
 
Posts: 1
Default Excel Automation : numbers Copy/Paste issue from VB6

Hi,

Here is the context of the issue I'm encountering:
- Windows decimal separator : , (column)
- Windows thousands sep : (blank)
- Excel set to use system separators.
- Excel version is Excel 2003

From VB6, I copy a number (146,876) to the clipboard (thus with a

decimal sep).
I then paste the number to the one cell in Excel using the following
code:
ExcelApp.ActiveSheet.Range("A1").Select
ExcelApp.ActiveSheet.Paste

The target cell will contain the number 146 876 (so no more decimal).
As the number is still in the clipboard, I switch to excel and hit the
Paste button. Ho miracle, the number is correctly pasted... If the
source number is something like 176,98 , it will be pasted as Text and
thus left aligned.
I checked the excelapp variable in the watch window, the decimal
separator is correctly set to column.

Any idea?

Thanks,

Olivier