I have a simple Access running VB (for file related function). It has been running happily but suddenly today, an error pop up saying:
Run time error '-2147024770 (8007007e)':
Automation error
The specific module could not be found.
When using debug mode, it stop at the 'Set FSO =...' statement. I am unable to understand what exactly is the problem.
I have double check the tools-reference and it is looks fine (no missing...). Also it runs on other PCs happily.
Have anyone have any idea or have encounter such error before?
Thanks in advance
Kar Yan
Private Sub Load_File_list(Dir As String)
Dim Fso As Object
Dim Folder, Files, File
Dim Cnt, ListCnt As Integer
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Folder = Fso.GetFolder(Dir)
Set Files = Folder.Files
ListFiles.Visible = True
ListFiles.RowSourceType = "Value List"
Do While ListFiles.ListCount > 0
ListFiles.RemoveItem (0)
Loop
For Each File In Files
ListFiles.AddItem (File.Name)
Next
End Sub
Run time error '-2147024770 (8007007e)':
Automation error
The specific module could not be found.
When using debug mode, it stop at the 'Set FSO =...' statement. I am unable to understand what exactly is the problem.
I have double check the tools-reference and it is looks fine (no missing...). Also it runs on other PCs happily.
Have anyone have any idea or have encounter such error before?
Thanks in advance
Kar Yan
Private Sub Load_File_list(Dir As String)
Dim Fso As Object
Dim Folder, Files, File
Dim Cnt, ListCnt As Integer
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Folder = Fso.GetFolder(Dir)
Set Files = Folder.Files
ListFiles.Visible = True
ListFiles.RowSourceType = "Value List"
Do While ListFiles.ListCount > 0
ListFiles.RemoveItem (0)
Loop
For Each File In Files
ListFiles.AddItem (File.Name)
Next
End Sub