Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yet more excel trouble
Message
 
 
À
26/01/2005 07:03:28
Jon Neale
Bond International Software
Wootton Bassett, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
00980651
Message ID:
00980703
Vues:
62
yep I clean up properly I'll skip the filling in sheet stuff but the code is as below, the error code I have currently gives me the line of crash but just states an exception, I'll try adding things to the error routine to test the object but I do know it has started excel as I get an excel process left over in task manager when I kill my system.

I've had it occasionally crash on the save and many times when making the copy graphic visible/invisible, it seems that excel is just not overly stable but as I said any help is good, thanks
oExcel = CreateObject("Excel.Application")
oworkbook = oExcel.workbooks.open(alltrim(basevars.baseljb) + "LaserJobbag.xls") 
If oworkbook.name <> savefilejustname && Determine whether to use save or save as
&& If the file exists then delete it
	If FILE (savefile)
		Erase (savefile)
	Endif
&& Save without any user dialog box
	oworkbook.saveas(savefile)
Else
&& Save it, since it has already been save with SaveAs
	oworkbook.save()
Endif

***** CUT - Filling in cells stuff, the only thing in there to note was getting oRange as a reference to a range of cells

If thisform.check2.value == 1 or forceprint == 1
	oworkbook.worksheets(1).Shapes.selectall
	oexcel.selection.shaperange.visible = 0 && make copy graphic invisible
	oworkbook.printout(,,1)
	oexcel.selection.shaperange.visible = 1 && make copy graphic visible
	oworkbook.printout(,,2,,,,1)
Endif
oworkbook.save()
orange = .NULL.
oworkbook.close(0)
oworkbook = .NULL.
oexcel.quit()
oExcel = .NULL.
Release orange
Release oworkbook
Release oExcel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform