ActiveX

G

Guest

I built a database using the following VBA code
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(CurrentProject.Path & "\LogonID.txt")
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
s = ts.ReadLine
Me.logon_id = s
ts.Close
All of my users execute the code above with no problems except for one.
They get an error when trying to execute the "Set ts =
f.OpenAsTextStream(ForReading, TristateUseDefault)". Any
ScriptingFileSystemObject access whether, deletefile, fileexists, etc
generates a message err.number is 429, err.description is "ActiveX component
can't create object". It sounds like the user is missing an .ocx activex
control. How do I determine which one they need if that is the problem? If
a missing ActiveX control is not the problem, then what is?

Please help...thanks in advance.
 
E

Eric Schittlipz

PeterM said:
I built a database using the following VBA code
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(CurrentProject.Path & "\LogonID.txt")
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
s = ts.ReadLine
Me.logon_id = s
ts.Close
All of my users execute the code above with no problems except for one.
They get an error when trying to execute the "Set ts =
f.OpenAsTextStream(ForReading, TristateUseDefault)". Any
ScriptingFileSystemObject access whether, deletefile, fileexists, etc
generates a message err.number is 429, err.description is "ActiveX component
can't create object". It sounds like the user is missing an .ocx activex
control. How do I determine which one they need if that is the problem? If
a missing ActiveX control is not the problem, then what is?

Please help...thanks in advance.


Has Windows Scripting Host been disabled as a security measure? Or is
anti-virus running? There may be a number of ways in which this has been
disabled. Do a Google search on "disable vbs" for examples.
 
G

Guest

Eric...thanks for responding. Actually there was a missing reference to
scrrun.dll. When I added it in the References, it worked fine...thanks again.
 

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