Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decimal places in excel
Message
From
21/09/2006 09:22:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01155911
Message ID:
01155945
Views:
28
>hi all,
>I have an app that creates an excel file and everything hunky dorey except one thing. the customer wants to see 2 decimal points in a numberic field and also a lead char of the euro sign. i have tried passing in the values below but all that shows up in excel is the value without the euro sign. has anyone any ideas? Idealy automatically formating the cell to numeric with 2 decimal places and using the euro symbol would be best i think but i don't know now to do it.
>
>"€ " + ALLTRIM(STR(mvalue,9,2))
>
>~M
NumberFormat = "[$€-2] #,##0.00"
ie:
lcSQL = 'select product_id,quantity,unit_price,quantity*unit_price as extPrice from orditems'
lcConnPath = _samples+'data\testdata.dbc'
lcConnectionString = [OLEDB;Provider=VFPOLEDB;Data Source=]+m.lcConnPath

* Create and save XLS once
oExcel = Createobject('Excel.Application')
With oExcel
  .Visible = .t.
  .Workbooks.Add
  With .ActiveWorkbook.ActiveSheet
    .QueryTables.Add( m.lcConnectionString, ;
    .Range("A1"),;
      m.lcSQL).Refresh
    .UsedRange.Columns(4).NumberFormat =  "[$€-2] #,##0.00"
  EndWith
EndWith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform