Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running Excel from VFP App
Message
De
06/05/2006 11:55:21
 
 
À
06/05/2006 10:41:53
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01119766
Message ID:
01119877
Vues:
13
Mr. Bazos, testing the process I got this error: the file isclassregistered.prg not exist.

I put the code the following way:
xresp = MESSAGEBOX('El process is ok'+ chr(13)+;
		 '¿Open Excel?', 36, 'InternetBanking')
		IF xresp = 6
			thisform.convertirxls()
		else	
			=MESSAGEBOX('The was put', 64, 'InternetBanking')   
		endif	

Method Convertirxls
if !IsClassRegistered("Excel.Application")
	= messagebox("Excel is no installed.")
else
	indica='\archivos\'+indicador+".xls"
	rank='\archivos\'+periodo+".xls"
	oexcel = createobject("excel.application")
	  with oexcel
		.workbooks.open(m.indica)
	    	.visible = .t.
		 with .activeworkbook.activesheet
		      .range("e:e").numberformat = "#,##0"
		      .range("f:f").numberformat = "#,##0.00"
		      .range("a1:f1").font.bold=.t.
			 with .range("a:f").font
			      .size=10
			      .name='tahoma'
			 endwith
	      	.range("a:f").entirecolumn.autofit
	      	.range("a1:f1").horizontalalignment = -4108
	      	.range("a1:f1").verticalalignment = -4108
    		endwith
    		.activeworkbook.save
    		.workbooks.open(m.rank)
    		with .activeworkbook.activesheet
		      .range("c:c").numberformat = "#,##0.00"
		      .range("d:d").numberformat = "#,##0"
		      .range("a1:f1").font.bold=.t.
	      	with .range("a:f").font
			        .size=10
			        .name='tahoma'
		      endwith
		      .range("a:f").entirecolumn.autofit
		      .range("a1:f1").horizontalalignment = -4108
		      .range("a1:f1").verticalalignment = -4108
		endwith
	     .activeworkbook.save
		endwith
endif
return .t.
end method

Method IsClassRegistered
#DEFINE HKEY_CLASSES_ROOT    -2147483648
#DEFINE ERROR_SUCCESS		0	&& OK

DECLARE Integer RegOpenKey IN Win32API ;
	Integer nHKey, String @cSubKey, Integer @nResult

DECLARE Integer RegCloseKey IN Win32API ;
	Integer nHKey

local lnKey
lnKey = 0
llRetVal = ( RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS )
if llRetVal
  RegCloseKey(lnKey)
endif
return llRetVal
end method
Where the error is?

Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform