Click to See Complete Forum and Search --> : ACTIVE X PROBLEM
obijuan
February 16th, 2000, 08:04 AM
I think the error was Active X Error Something about GetObject.
My program doesn't work when shelling out another program. For example.
Result = shell(c:\winnt\system32\evntvwr.exe) & "\\" & txtcomputername.text
It works in my project and on the computer I have written this app on. However any other computer gets an Active X error. Please email me with a hopeful answer...
juan.torres@bcbsfl.com
Juan Torres
Kyle Burns
February 16th, 2000, 08:26 AM
Is this the exact code you're using? You're indicating that Result should contain a string consisting of the result of shell(c:\winnt\system32\evntvwr.exe) (this would fail because you didn't use quotes around your path) followed by "\\" and the text that's in txtcomputername. If this isn't the actual code you're using, please copy and paste your code.
obijuan
February 16th, 2000, 08:38 AM
I dont know if you got my reply.
Public Function Eventviewer()
Dim FileSystem As Object
Dim exists As Boolean
Dim eventview As Double
Dim Eventviewer1 As String
Eventviewer1 = "c:\winnt\system32\Eventvwr.exe"
Set FileSystem = CreateObject("scripting.filesystemobject")
exists = FileSystem.fileexists(Eventviewer1)
If exists Then
If frmping.txtcomputername = "" Then
MsgBox "Please enter a computer name..."
Else
frmping.lbltitle.Caption = "Event Viewer is Open on " & frmping.txtcomputername
eventview = Shell(Eventviewer1 & " \\" & frmping.txtcomputername, vbNormalFocus)
End If
Else
MsgBox "Please make make sure the eventvwr.exe is in the c:\winnt\system32 directory"
End If
End Function
Sorry if you did already
Juan Torres
Blue Cross Blue Shield of Florida
Configuration Management & Distribution Solutions
"Procastinating may be a bad habit, but a good tool for learning many different outcomes in life."
Kyle Burns
February 16th, 2000, 08:53 AM
I'd say that the chances that the error message youreceived was a result of your CreateObject("Scripting.FileSystemObject") call. Try installing the scripting runtime on the target computer. Another option for you would be to set a reference to the scripting runtime in your project and declare FileSystem as Scripting.FileSystemObject instead of Object. Then you can create an install program that will include the scripting library. If you don't declare the variable as Scripting.FileSystemObject, then your app doesn't know it needs the scripting runtime until it has already failed.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.