Correct syntax for use Replace command via DDE?

B

Bjørn Holm

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
(e-mail address removed)
 
G

Guest

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
 
B

Bjørn Holm

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
(e-mail address removed)


<[email protected]> 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
 
K

Kevin McCartney

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
(e-mail address removed)


<[email protected]> 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
(e-mail address removed)


.


.
 
B

Bjørn Holm

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
(e-mail address removed)

"Kevin McCartney" <[email protected]> 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
(e-mail address removed)


<[email protected]> 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
(e-mail address removed)


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top