Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running Excel from VFP App
Message
De
06/05/2006 15:57:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
06/05/2006 11:55:21
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:
01119889
Vues:
17
>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.

I see Method ... there. Are these codes in a form or class? If so then precede them with thisform.

if !thisform.IsClassRegistered

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform