borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2011 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (How Can I Extract DLL Functions, Subs, Etc.?) New Topic New Poll Post Reply
AndreaVB Forum : ActiveX : Can't explain why! Please Help!ActiveX Component Can't Create object
Poster Message
devesh67
Level: Trainee

Registered: 10-01-2006
Posts: 1

icon Can't explain why! Please Help!ActiveX Component Can't Create object

Hi All, I'm posting a ques for the 1st time.

I have a strange problem:

I developed an import program and it works fine on my pc. But on the testers pc it doesn't. There is a functionaly called process which creates a late bound filesystemobject. When the process button is clicked the tester gets error 429.

More strange is that it worked once(  when i late bound the dll and built a new install) But afterwards I was required to make some modifications and built another install. But the same error occurs now.

I'm shipping the scrrun. Everything works fine on my pc, it's just that the tester is getting the error.

Please advise!


The process functionality code is:

Private Sub cmdProcess_Click()

If iRunValidate = 1 Then

    If ValidateFields = False Then
     Exit Sub
    End If
    
    'Disable Buttons
    cmdValidate.Enabled = False
    cmdClose.Enabled = False
    cmdCancel.Enabled = False
    cmdView.Enabled = False
    cmdProcess.Enabled = False
    cmdImport.Enabled = False
    cmdLog.Enabled = False
    cboEr.Enabled = False
    
    Call setMainValues
    
    'Set MousePointer to Hour Glass
     Screen.MousePointer = vbHourglass
    
    Call ImportKronosFile(sImportFile)
    
    'Set Mouse Pointer to Normal
     Screen.MousePointer = vbDefault
    
    'Set Process Flag to True
    iRunFlag = 1
    
    'Enable some Buttons
    cmdClose.Enabled = True
    cmdView.Enabled = True
    
     'Set Focus to View Log File Button
     cmdView.SetFocus
    
Else

  MsgBox "Validate Process has not been run, Please Run Validate Process", vbExclamation, "Insync "
    
End If

End Sub

Private Sub ImportKronosFile(sFileName As String)

Dim lngLineCnt As Long
Dim lFileLineCount As Long

'Variable to Read a Line from the file
Dim strLine As String
Dim iPbvalue As Double

'Create Filesystem Object To access Read Import File
Set fs = CreateObject("Scripting.FileSystemObject")

Set tsIn = fs.OpenTextFile(sFileName, 1, False)

'Get the Number Of Line in the File to Synchronize The ProgressBar
lFileLineCount = fLineCnt(sFileName)

'Set Focus on the form
Me.SetFocus

If tsIn.AtEndOfStream Then
Exit Sub
End If

   Do Until tsIn.AtEndOfStream
  
       'Start Reading Lines in the File as From the 3rd Line
        If lngLineCnt > 1 Then
            strLine = tsIn.ReadLine
            lngLineCnt = lngLineCnt + 1
            
            If lngLineCnt <= lFileLineCount Then
             iPbvalue = (lngLineCnt) / lFileLineCount
            End If
                        
            If iPbvalue > 0.99 Then
            pbProgress.Value = Fix(iPbvalue * 100)
           ' lblProgress.Caption = Fix(iPbvalue * 100) & "%"
            Else
             pbProgress.Value = (iPbvalue * 100)
           '  lblProgress.Caption = Fix(iPbvalue * 100) & "%"
            End If
            
            DoEvents
            
            ProcessLine (strLine)
            
            If tsIn.AtEndOfStream = True Then
             Exit Do
            End If
                              
        End If
        
        If lngLineCnt <= 2 Then
          strLine = tsIn.ReadLine
         lngLineCnt = lngLineCnt + 1
        End If
   Loop
      
'Free Memory
Set fs = Nothing
Set tsIn = Nothing

'Notify User that Processing is complete
MsgBox "Processing completed", vbInformation, "Insync"
  
End Sub








10-01-2006 at 11:39 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 607
icon Re: Can't explain why! Please Help!ActiveX Component Can't Create object

Hi,
Sounds to me like your testers PC does not have, or has an older version of, Windows Scripting Host. Either that, or there is a known bug when running a script using Windows Script Host (WSH) 5.6 on a Windows XP-based computer - http://support.microsoft.com/kb/311269/en-us

If none of that is any use I would suggest you search MSDN for "WSH" - that will give you plenty of ideas.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

13-01-2006 at 08:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ActiveX : Can't explain why! Please Help!ActiveX Component Can't Create object
Next Topic (How Can I Extract DLL Functions, Subs, Etc.?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2011 Andrea Tincaniborder