Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hex values converted to exponents during Excel Automatio
Message
From
28/01/2004 18:46:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
28/01/2004 18:17:11
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00871210
Message ID:
00871610
Views:
13
This message has been marked as the solution to the initial question of the thread.
>...
>I've done this and now in each cell, the data is '2E63 but displays as 2E63. I'll have to contact the end user of the spreadsheet and see if this is acceptable.
>
>The ideal solution would be a NumberFormat of 'Text' similar to the 'General' option. I'll see if I can play around with this more. I'll let you know if this works. :)

There is a separate "Text" format in Excel. You would probably have to set this first, and then insert the value. Using the macro editor in Excel, and applying this format, gives me:
Selection.NumberFormat = "@"
Adapting this to VFP would produce a command similar to the following:
oSheet.Cells(lnRow, lnCol).NumberFormat = "@"
oSheet.Cells(lnRow, lnCol).Value = "2E63"
See if this works; I don't have VFP at hand right now.

>
>By the way, this is Office 97 and VFP6sp5 otherwise I'd press for getting something like xfrx and just printing the report to an .XLS file.

Automation should be almost identical in Office 97 and 2000, as well as later versions, AFAIK.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform