Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error on setting page to excel format
Message
De
02/06/2003 03:54:18
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Error on setting page to excel format
Divers
Thread ID:
00795094
Message ID:
00795094
Vues:
63
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform