Excel TOleAuto - Find & replace function ...

Excel TOleAuto - Find & replace function ...

Postby Rimantas » Wed Apr 23, 2008 8:16 am

Hi !

In workplace changed mine PC and with a new Office 2007 . Sorry , but it seems that CHM files of VBAXL10 is empty ( 2b ) . So I can't to view how Find & Replace function can work . It's needful for me that in TExcelsScript class . Maybe you are using something ? Any sample ?

With best regards and thanks in advance ! Rimantas
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Postby Gale FORd » Wed Apr 23, 2008 1:15 pm

Don't forget, you can record a macro in Excel then perform your actions and then go back and look at the commands it created.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Postby Rimantas » Wed Apr 23, 2008 6:20 pm

Gale FORd wrote:Don't forget, you can record a macro in Excel then perform your actions and then go back and look at the commands it created.


A good advice ! :) Thanks ! I'll look into that . But maybe other person have experience with that ? Because transfer from VBA to FWH syntax is complicated and it tooks some hours tries . So any help it will accelearte process ... :)

I looked into macro - here is a piece of source

Code: Select all  Expand view  RUN
    Selection.Replace What:="QWE", Replacement:="555", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False



Of course , I'll try to convert that to FWH . But I'll thankfull for any help , how to do that .

With best regards ! Rimantas
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Postby Rimantas » Wed Apr 23, 2008 6:57 pm

Rimantas wrote: I looked into macro - here is a piece of source
Code: Select all  Expand view  RUN
    Selection.Replace What:="QWE", Replacement:="555", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False



Of course , I'll try to convert that to FWH . But I'll thankfull for any help , how to do that .



After some research I created new method for TExcelScript class . Here is a code :

Code: Select all  Expand view  RUN
METHOD FReplace( nCol, cWhat, cReplacement, nLookAt, nSearchOrder, lMatchCase, lMatchByte, cSearchFormat, cReplaceFormat ) CLASS TExcels
   Default nCol         := ::oCell:Column
   Default nLookAt      := 1 // xlWhole = 1 , xlPart = 2
   Default nSearchOrder := 2 // xlByColumns = 2 , xlByRows = 1
   Default lMatchCase   := .f.
   
   ::oSheet:Columns( nCol ).Replace( cWhat, cReplacement, nLookAt, nSearchOrder, lMatchCase )
return( NIL )


With best regards ! Rimantas
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests