Missing Microsoft Scripting Runtime

Terry P

Active Member
Joined
Nov 28, 2002
Messages
256
I have the following code:
Private Sub ComboBox1_DropButtonClick()
Calculate
Me.ComboBox1.Clear
Dim X As String
Dim myFileSystem As Object
Dim myFolder As Object
Dim myFiles As Object
Dim myFile As Object
Const TargetFolder As String = "C:\Accts"
Const myExtension As String = "*.xls"
ComboBox1.Value = ""
ComboBox2.Value = ""

'*** this next line is where the problem is ***
Set myFileSystem = CreateObject("Scripting.FileSystemObject")

On Error Resume Next
Set myFolder = myFileSystem.GetFolder(TargetFolder)
If Err <> 0 Then MsgBox "Unable to find folder.": Exit Sub

Set myFiles = myFolder.Files
For Each myFile In myFiles
If Right(LCase(myFile.Name), 4) Like myExtension Then
Me.ComboBox1.AddItem myFileSystem.GetBaseName(myFile.Name)
End If
Next myFile
Set myFolder = Nothing
Set myFileSystem = Nothing
End Sub

*** I get '429 Activex component can't create object error'

It worked fine in the past on 97, 2000 & 2002 but now doesn't so I must have done something silly!

Reading other threads on the subject refer to making a Reference to 'Microsoft Scripting Runtime'. I don't recall making a Reference to 'Microsoft Scripting Runtime' before and can't find it in the list.

In another thread it refers to SCRRUN.DLL and I have this in system32.

What on earth am I missing?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
'Microsoft Scripting Runtime'
Find and check it in VB Editor Tools/References.

EDIT
If it is not there, I think it will be on the MS Office setup disk and/or downloadable from Microsoft. I do not recall ever having to do this as an extra job.
 
Upvote 0
Thanks for reply Brian.
But as I said I can't see 'Microsoft Scripting Runtime' in Reference list in either 97, 2000 or 2002 lists.
 
Upvote 0
Sorry - I thought this might be the case, but some people look forit in thewrong place (workbook references). See my edit to the original post.
 
Upvote 0
Sorry did not complete that!

I have just re-installed excel 97 to no avail.
I'll try reinstalling again and come back if I still have the problem.
Thanks
 
Upvote 0
I have just done a Google search on 'Microsoft Scripting Runtime' which gives all sorts of references, including a downloadable Microsoft file.
 
Upvote 0
Thanks Brian
I re-installed office 97 again this didn't fix it so I did as suggested and got the files via Google and works fine now.
I only wonder how it happened in the first place!!
Many thanks again
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,821
Members
449,340
Latest member
hpm23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top