Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extracting a few cells from an excel spreadsheet
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01371276
Message ID:
01375488
Views:
17
>The line
>
>oExcel.workbook.close
>
>causes an error that no member named workbook exists.

Here is what I currently have (39 is not the best format, though)
	IF '12' $ .VERSION && XL 2007
* Kevin Delaney's suggestion & Cetin Basoz suggestion
			.ActiveWorkbook.SAVEAS(m.tcDestination, 39) && xlExcel7
			.ActiveWorkbook.Saved = .T.
			.ActiveWorkbook.CLOSE(0)
		ELSE
			.WorkBooks(1).SAVEAS(m.tcDestination)
		ENDIF

		.ScreenUpdating = .T.
		.DisplayAlerts = .T.
	ENDWITH

CATCH TO loError
	lcError = Log_Error(m.loError)
FINALLY
	IF VARTYPE(m.loExcel) = 'O'
		WITH loExcel
			.ScreenUpdating = .T.
			.DisplayAlerts = .T.
			.QUIT()
		ENDWITH
	ENDIF
ENDTRY
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform