Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extract Excel Documents from general Fields.
Message
 
To
26/05/2005 07:42:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Oracle
Miscellaneous
Thread ID:
01017766
Message ID:
01017784
Views:
24
This message has been marked as the solution to the initial question of the thread.
Tim, try this:
use your_table
Genfieldname="lcfile"	&& General field name

GO (recno_you_need)

local oForm
oForm = Createobject('_Form',GenFieldName)
WITH oForm.myOle1
	IF .oleclass="Excel.Sheet"
		ERASE c:\hi.xls
		.object.saveas("c:\hi.xls")  && it creates the file, 
                            *  but with the Hidden Window
		
		* now open the file, unhide Window and save again
		oExcel=CREATEOBJECT("Excel.Application")
		WITH oExcel
			.DisplayAlerts = .f.
			.Workbooks.Open("c:\hi.xls")
			.Windows(1).visible=.t.
			.Workbooks(1).Save()
		ENDWITH

		oExcel.Quit
		oExcel=.null.
		RELEASE oExcel

	ELSE
		?"?  OLeclass: ", .oleclass
	endif	
ENDWITH

=oForm.Release()

RETURN
*----------------
Define Class _Form As Form
	PROCEDURE iNIT
		LPARAMETERS pGenFieldName
		this.addobject('myOLe1',"OleBoundControl")
		this.myole1.ControlSource = ALIAS()+'.'+pGenfieldName
	ENDPROC
Enddefine
*-------------------------------------
>Hi,
>I have an Excel Document stored in a General Field. (I know they are hard to get out thats why I want to move away from them..). Anyways I have some old data I need to extract from teh General Fields and save as a file.
>
>I tried all posted code about this but nothing works:
>
>Does anyone have a way to get specifically excel files out of the general field and save it as a file?
>
>Tim
Previous
Reply
Map
View

Click here to load this message in the networking platform