|
-
Sep 6th, 2005, 06:38 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Microsoft Scripting Runtime
Hi guys,
I'm trying to use the Split() method in a module and I'm receiving an error informing me the function is undefined. I've inlcuded the Scripting Runtime in the references to the project but it's not made a difference.
Any idea why this might be happening?
Thanks
Last edited by MethadoneBoy; Sep 6th, 2005 at 09:39 AM.
Reason: Resolved
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Sep 6th, 2005, 06:45 AM
#2
Lively Member
Re: Microsoft Scripting Runtime
What version of Excel are you using?
-
Sep 6th, 2005, 07:35 AM
#3
Re: Microsoft Scripting Runtime
I fail to see what the FileSystemObject has to do with this error..
Split is a VBA function, and this error will be due to either "MISSING" references, unsupported by the version of the VBA application you are using, or failure to disambiguate your code..
To disambiguate you will need to determine which other reference you are using and proceed the Split() with the reference itself..
For Example
VB Code:
Dim MyStr() As String
MyStr = VBA.Split("Danny|M|King","|")
Debug.Print MyStr(0)
Debug.Print MyStr(1)
Debug.Print MyStr(2)
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 6th, 2005, 07:35 AM
#4
Thread Starter
Addicted Member
Re: Microsoft Scripting Runtime
It's Access, sorry should have specified that - Microsoft Access 97
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Sep 6th, 2005, 07:36 AM
#5
Re: Microsoft Scripting Runtime
Type VBA followed by the . if this is not in the list then it is not supported..
As far as I remember Access 97 does not support Split (It's A 2k or above function)
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 6th, 2005, 07:58 AM
#6
Thread Starter
Addicted Member
Re: Microsoft Scripting Runtime
Thanks for the help - you're right, of course. Access 97 doesn't support Split.
Are there any other ways that a String can be "tokenized" using Access 97?
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Sep 6th, 2005, 08:37 AM
#7
Re: Microsoft Scripting Runtime
You would be better off creating your own split function to perform a similar job something like..
VB Code:
Private Function SplitStr(pString As String, pDelim As String, rArr() As String) As Boolean
Dim strTemp As String
Dim i As Long
On Error GoTo ForcedExit
SplitStr = False
ReDim rArr(1 To 1)
Do While InStr(pString, pDelim) > 0
strTemp = Left(pString, InStr(pString, pDelim) - 1)
i = i + 1
ReDim Preserve rArr(1 To i)
rArr(i) = strTemp
pString = Mid(pString, InStr(pString, pDelim) + 1)
Loop
'there could be one more left so test and append if so
If Len(pString) > 0 Then
i = i + 1
ReDim Preserve rArr(1 To i)
rArr(i) = pString
End If
SplitStr = True
ForcedExit:
On Error GoTo 0
End Function
Sub test()
Dim MyStr() As String
If Not SplitStr("Danny|M|King", "|", MyStr()) Then Exit Sub
Debug.Print MyStr(1)
Debug.Print MyStr(2)
Debug.Print MyStr(3)
End Sub
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 6th, 2005, 09:38 AM
#8
Thread Starter
Addicted Member
Re: Microsoft Scripting Runtime
Guess it's time I requested a newer version of Access.
Thanks for all the help, especially that last piece of code!
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|