Hi,
Wen I first started VBA programming I experienced issues with some of
the string commands. By adding "Option Explicit" to all forms and
modules, then running [Debug][Compile] I identified quirks in the code.
Once these were resolved I've never had a problem.
Regards
Laurie
Paul Richardson wrote:
> Mark - I wish I could tell you why but had the same problem with code not running on a few machines
> and breaking at the VBA string functions. I didn't have any local functions with the same name so I don't
> know what the issue was - just that calling the VBA string functions explicitly solved the problem. I just
> call all VBA functions explicitly now.
>
> OP - Don't know why the file size doubled, strange. Must be something out there on the net,
> please let us know if you find out.
>
> "MP" wrote in message news:5977509@discussion.autodesk.com...
> Hi Paul,
> He said your solution worked but I'm surprised
> I've never seen a situation where one had to preface inbuilt functions with
> the library name
> ...unless you had local versions with a different definition
>
> Sub TestRight()
> Debug.Print Right("Somestring", 4)
> Debug.Print VBA.Right$("Somestring", 4)
> End Sub
> Function Right(sInput As String, lVal As Long) As String
> Right = "Local version"
> End Function
>
> but since it worked on many machines and not on one or two that tells me
> that's not the case
>
> he didn't specifiy the error but I'd bet it was function undefined or
> however that reads
> which you get on built-in funcitons (often string functions...usually Left
> ro Left$ but also Right etc) when you have a reference missing...
> that was my guess any way
> which was apparently wrong because in that case adding the lib preface
> wouldn't have fixed it....
>
> so why did you think of that and why did it work???
>
> mark
>
>
> "Paul Richardson" wrote in message
> news:5977140@discussion.autodesk.com...
> try explicitly calling your native VBA functions.
> VBA.Right(...)
>
> wrote in message news:5977128@discussion.autodesk.com...
> Can't figure out why this code does not work on 2 of my user's PC
> ...
> With ThisDrawing.Utility
> .GetEntity ent, pickpt, vbCr & "Select an object: "
> If ent Is Nothing Then
> .Prompt vbCrLf & "Invalid Selection"
> Exit Sub
> Else
> ent.Highlight True
> End If
>
> End With
>
> ent.GetXData "", datType, datval
> adelekey = Right(datval(0), Len(datval(0)) - 3)
> ...
>
> The RIght method is where I am getting an error. but I have no trouble with
> it on 60+ user PC include my own and 2 other test PCs.
>
> Any help would be appreciated.
>
> Vito