View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bjørn Holm Bjørn Holm is offline
external usenet poster
 
Posts: 3
Default Correct syntax for use Replace command via DDE?

Here is the equivalent function in Word, that I have gotten working:
[EditReplace .Find="@what", .Replace="@with", .WholeWord=0, .MatchCase=0,
..Format=0, .ReplaceAll=1]

How to get this to work in Excel?

regards,
Bjørn Holm
Nordak as
Norway


"Kevin McCartney" skrev i melding
...
Hi Bjørn

I've looked at the help in Excel and it indiactes that the
Replace is a worksheet function so I think you may have to
use Application.WorksheetFunction.Replace

I don't have an example because I've never needed to
Replace via DDE but I would expect the principle to be the
same.

Best of luck
KM
-----Original Message-----
Hi KM!
Still can't get it to work. I have also tried different

variations of your
example, but without luck.
Do you have an example that is confirmed to be working?

regards,
Bjørn Holm
Nordak as
Norway



skrev i melding
...
Hi,
I think you'll need to place Excel.Application.Workbook
("YourWork.xls").ActiveSheet.Cells.Replace (What:="@what",
Replacement:="@with", LookAt:=xlPart,
SearchOrder:=xlByRows, MatchCase:=False)

Hope this helps
regards
KM

PS I'm still looking for a proper solution but I think
that the the way you juat call Cells.Replace .... the
application does not know what to do to what sheet in what
workbook

-----Original Message-----
Hi.
I am trying to run the Find/Replace command in Excel

remotely via DDE.
What is the correct syntax for doing this?

I have tried this:

[Cells.Replace What:="@what", Replacement:="@with",

LookAt:=xlPart,
SearchOrder:=xlByRows, MatchCase:=False]

but with no luck.
Is there a list of correct syntaxes for Excel VBA-

commands run via DDE
anywhere? I have searched on the web without finding

anything.

regards,
Bjørn Holm
Nordak as
Norway



.



.