Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error on setting page to excel format
Message
From
02/06/2003 03:54:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Error on setting page to excel format
Miscellaneous
Thread ID:
00795094
Message ID:
00795094
Views:
64
Hi all,

I always get an error if I want to set the report pages from VFP into exel format,
the error is 'OLE dispatch exception code 0 from ?; ?..'.

The code that I use for setting the pages is :
tmpsheet = GetObject('','excel.application')
XLApp = tmpsheet.application
XLApp.Visible = .t.
XLApp.WorkBooks.Add()
XLSheet = XLApp.ActiveSheet
* Setting Page setup degan LETTER 8 1/2 X 11 inch LANDSCAPE *
With xlsheet.PageSetup
	.LeftMargin = xlapp.InchesToPoints(0.0)
	.RightMargin = xlapp.InchesToPoints(0)
        .TopMargin = xlapp.InchesToPoints(0.25)
        .BottomMargin = xlapp.InchesToPoints(0.25)
        .Orientation = xlPortrait
        .PaperSize = xlPaperFanfoldUS
EndWith
I don't know if my code is wrong or I miss something, please advise.

TIA,

Budianto
Next
Reply
Map
View

Click here to load this message in the networking platform