Visio Libraries (VBA/VB) which ones to Add-in?

D

Dennis

Visio 2003

Currently my "new" installation of Visio 2003 can not find the Substitute()
function. (Is my problem some other issue than library?)

What library do I need to install or Add-in to enable Visio VBA to access
that function?

Better, what libraries are considered necessary for "medium" level Visio VBA
use?

Dennis
 
A

Al Edlund

Dennis,
try this (I've been busy with my daughters wedding)
al

Public Function funcReplaceStr(ByVal strIn As String, _
ByVal strSearch As String, ByVal strReplace As String, _
ByVal lngCompMode As Long) As String

Dim strWork As String
Dim lngIndex As Long

If (strIn = "") Then
funcReplaceStr = ""
Else
strWork = strIn
lngIndex = InStr(1, strWork, strSearch, lngCompMode)
Do While lngIndex > 0
strWork = Left(strWork, lngIndex - 1) & strReplace &
Mid(strWork, lngIndex + Len(strSearch))
lngIndex = InStr(lngIndex + Len(strReplace), strWork,
strSearch, lngCompMode)
DoEvents
Loop
funcReplaceStr = strWork
End If
End Function
 
D

Dennis

Al,

Hope all went well (assuming the wedding is over?)

When you have time, if that is ever true, could your check out the following
code? The code is 99% yours as pieced together by me from various "Al"
posting in the last two years re: Copy/Past VBA.

Each time I get an update from you, I try the code and i fails somewhere
else. Believe me, I am trying to figure this out for myself but I know
enough about (Visio) VBA to be dangerous. It seems that Visio has challenges
coming up to the typical MS Visual Basic reliability and predictability.

I believe that the last failure I had was due to me not activating similar
Visio related VB libraries as I was getting Function not defined errors (see
below).

Therefore, it is possible that with your funcReplaceStr() submitted below
AND me having all the necessary libraries loaded that the code may well work.
[Most recently, Visio VBA could not find Substitute()].

Dennis
 

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