Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Void excel 'To save?' message
Message
De
23/04/2009 05:36:23
 
 
À
23/04/2009 04:52:18
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01396028
Message ID:
01396034
Vues:
51
>Hi
>Help please,
>
>I call excel worksheet functions from vfp.
>I change one cell and return value from other.
>As following
>set strictdate to 0
>messagebox(alltrim(gethebdate({12/16/1969})))
>set strictdate to
>function gethebdate
>	lparameters djdate
>	local chebdate
>	set strictdate to 0
>	objexcel= createobject("Excel.Application")
>	oworkbook = objexcel.workbooks.open('c:\c.xls')
>	osheet = oworkbook.activesheet
>	osheet.cells(3,2).value= djdate
>	chebdate=osheet.cells(3,3).value
>	objexcel.quit
>	return chebdate
>endfunc
>It's work fine but Excel ask me if to save the change and its very unnecessary service for me.
>How can I void it?
>Thanks


You'll have to use

objExcel.DisplayAlerts = .f.

then

oworkbook.saveas("c:\ctemp.xls")

then rename ctemp.xls over your old file.

Nick
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform