Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Useful DBF2Excel routine
Message
From
02/03/2006 08:30:43
 
 
To
17/02/2006 17:05:52
Luis Navas
Independent Consultant
Auckland, New Zealand
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01097203
Message ID:
01100832
Views:
12
This is quick an easy, but how do you prevent character columns containing numbers from becoming numeric. For example a code like '0501' should not become 501.

Einar

>Another approach:
>
>
>Local oExcel As "Excel.Application", loError As Exception
>_Vfp.DataToClip(Select(),,3)
>Try
>	oExcel=CreateObject("Excel.Application")
>Catch To loError
>EndTry
>With oExcel
>	.Workbooks.Add()
>	.Workbooks(1).Sheets(1).Paste
>	.Workbooks(1).Sheets(1).Cells.Select
>	.Workbooks(1).Sheets(1).Cells.EntireColumn.AutoFit
>	.Visible=.T.
>EndWith
>
>
>
>Luis Navas
>>Oops, just googled Dbf2Excel and found FoxyClases is using that name for one of their classes. Sorry about that.
>>
>>Alex
>>
>>Hi,
>>
>>I needed this little routine and thought it may be useful to others:
>>
>>* DBF2Excel.prg This routine is meant to be called with a table open in current area
>>* Creates table in FOX2X format and opens with Excel
>>LOCAL lcTemp,loExcel
>>lcTemp = FORCEPATH(SYS(2015) + '.tmp',SYS(2023))
>>COPY TO (lcTemp) FOX2X
>>loExcel = CREATEOBJECT('Excel.Application')
>>loExcel.WindowState = -4137  && xlMaximized
>>loExcel.Workbooks.Add(lcTemp)
>>loExcel.Visible = .t.
>>
>>
>>Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform