Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI,
I am working on the excel part.I wanted to know is there any way that we can read the thousand separator or decimal separator used by user in excel.Is there a way that this can be done without opening the excel which means for example if user have opened the excel and have set the thousand separators format to comma , and closed the excel.

Can i read that format

What I have tried:

i know that it works by giving the path i wanted to know if with out path will it works
Posted
Updated 1-Jun-17 10:44am
Comments
CHill60 21-Jun-16 7:14am    
Well you are going to have to open the spreadsheet. The number format will be cell or column or row based, not at the worksheet level. Nor have you explained how you are handling Excel in your application - is this interop for example?
Your comment about "the path" is meaningless and confusing.

1 solution

Sub ShowSeparatorInfo()
    Dim ap As Application
    Set ap = Excel.Application
    With ap
        Debug.Print .DecimalSeparator
        Debug.Print .ThousandsSeparator
        Debug.Print .UseSystemSeparators
    End With

End Sub


UseSystemSeparators needs to be set to FALSE if the Decimal and Thousands separators are set to something non-standard.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900