ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   needing help with replace(c.value (https://www.excelbanter.com/excel-programming/406243-needing-help-replace-c-value.html)

PhrozenRoad

needing help with replace(c.value
 
I am new to excel programing but have been using it to instigate commands and
scripts to multiple workstations in a corporate enviroment.
basicly my latest macro involves opening the root directory on various
workstations in explorer.
but MSVBS will not let me introduce "\c$" at the end it forces "\ c$" is
there some sort of escape caracter in vb that will alow this?

****************
retval = Shell("c:\Windows\explorer.exe \\" & Replace(c.Value, "connected ",
"" \c$), vbMaximizedFocus)
****************

Chip Pearson

needing help with replace(c.value
 
There are a number of problems with the strings and the quotes. Try

RetVal = Shell("c:\Windows\explorer.exe \\" & _
Replace(C.Value, "connected ", "") & " \c$", vbMaximizedFocus)



--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"PhrozenRoad" wrote in message
...
I am new to excel programing but have been using it to instigate commands
and
scripts to multiple workstations in a corporate enviroment.
basicly my latest macro involves opening the root directory on various
workstations in explorer.
but MSVBS will not let me introduce "\c$" at the end it forces "\ c$" is
there some sort of escape caracter in vb that will alow this?

****************
retval = Shell("c:\Windows\explorer.exe \\" & Replace(c.Value, "connected
",
"" \c$), vbMaximizedFocus)
****************



PhrozenRoad

needing help with replace(c.value
 
that worked perfectly
i was just starting to take a step back and wonder if something like that
would work. Thank you for your insight.

"Chip Pearson" wrote:

There are a number of problems with the strings and the quotes. Try

RetVal = Shell("c:\Windows\explorer.exe \\" & _
Replace(C.Value, "connected ", "") & " \c$", vbMaximizedFocus)



--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"PhrozenRoad" wrote in message
...
I am new to excel programing but have been using it to instigate commands
and
scripts to multiple workstations in a corporate enviroment.
basicly my latest macro involves opening the root directory on various
workstations in explorer.
but MSVBS will not let me introduce "\c$" at the end it forces "\ c$" is
there some sort of escape caracter in vb that will alow this?

****************
retval = Shell("c:\Windows\explorer.exe \\" & Replace(c.Value, "connected
",
"" \c$), vbMaximizedFocus)
****************



Chip Pearson

needing help with replace(c.value
 
I think I misread what you were trying to accomplish. Try instead the
following code:

RetVal = Shell("c:\Windows\explorer.exe \\" & _
Replace(C.Value, "connected ", " \c$"), vbMaximizedFocus)


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"Chip Pearson" wrote in message
...
There are a number of problems with the strings and the quotes. Try

RetVal = Shell("c:\Windows\explorer.exe \\" & _
Replace(C.Value, "connected ", "") & " \c$", vbMaximizedFocus)



--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"PhrozenRoad" wrote in message
...
I am new to excel programing but have been using it to instigate commands
and
scripts to multiple workstations in a corporate enviroment.
basicly my latest macro involves opening the root directory on various
workstations in explorer.
but MSVBS will not let me introduce "\c$" at the end it forces "\ c$" is
there some sort of escape caracter in vb that will alow this?

****************
retval = Shell("c:\Windows\explorer.exe \\" & Replace(c.Value, "connected
",
"" \c$), vbMaximizedFocus)
****************




PhrozenRoad

needing help with replace(c.value
 
No that actually worked its such a simple thing i was needing, I just didn't
have the background in prog to understand the arguments as most people would

"Chip Pearson" wrote:

I think I misread what you were trying to accomplish. Try instead the
following code:

RetVal = Shell("c:\Windows\explorer.exe \\" & _
Replace(C.Value, "connected ", " \c$"), vbMaximizedFocus)


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"Chip Pearson" wrote in message
...
There are a number of problems with the strings and the quotes. Try

RetVal = Shell("c:\Windows\explorer.exe \\" & _
Replace(C.Value, "connected ", "") & " \c$", vbMaximizedFocus)



--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"PhrozenRoad" wrote in message
...
I am new to excel programing but have been using it to instigate commands
and
scripts to multiple workstations in a corporate enviroment.
basicly my latest macro involves opening the root directory on various
workstations in explorer.
but MSVBS will not let me introduce "\c$" at the end it forces "\ c$" is
there some sort of escape caracter in vb that will alow this?

****************
retval = Shell("c:\Windows\explorer.exe \\" & Replace(c.Value, "connected
",
"" \c$), vbMaximizedFocus)
****************





All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com