needing help with replace(c.value

P

PhrozenRoad

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)
****************
 
C

Chip Pearson

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)
 
P

PhrozenRoad

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.
 
C

Chip Pearson

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)
 
P

PhrozenRoad

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
 
Top