Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding cells with string pattern
Message
 
À
31/01/2006 06:05:30
Hong Yew
People Quest
Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01091812
Message ID:
01091905
Vues:
11
Something like this:
clear
oExcel= CREATEOBJECT("Excel.Application")

xlValues=-4163
xlPart=2
xlByColumns=2
with oExcel
	.DisplayAlerts = .f.
	.Visible=.t.
	.Workbooks.Open(XLS_file_full_path_name)

	lcfind="string pattern"

    
	if .Selection.Find(lcfind, ,xlValues,xlPart, xlByColumns).Activate

		lcaddress=.ActiveCell.Address
		?lcaddress
		lo=.ActiveCell
		
		DO WHILE .Activesheet.Cells.FindNext(lo).Activate AND  .ActiveCell.Address # lcaddress
			
			?	.ActiveCell.Address
			lo=null
			lo=.ActiveCell
			
		ENDDO
	
	ENDIF
	
*	.Workbooks.Close()
*	.Quit()
endwith

oExcel=.NULL.
release oExcel
>Hi all
>
>I would appreciate if you could give me an idea how I can write the VFP9 code to read cells within a range of a worksheet that contains a specified string pattern. Your advice most appreciated. Thanks
>
>Best Regards
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform