omnibuster
02-03-2009, 02:54 PM
With ListBox , Selected Workbook opened correct, but when I put that "wbkb" in Sub.. I gived error:
Run-time error '424':
Object recuired
Private Sub Load_Click()
Dim wkbk As Workbook
'
'
With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
Set wkbk = Application.Workbooks.Open( _
Filename:=.list(i, 0), _
Format:=xlCSV, _
Delimiter:=",", _
ReadOnly:=False)
wkbk.Activate
UserForm1.Hide
' Do something
Windows("Smpl.xls").Activate
'Do something
Call UUS ' Included: wbkb.Activate ???Error???
End If
Next i
End With
End Sub
Sub UUS()
wbkb.Activate ???
Range("A1").Select
ActiveSheet.Paste
End Sub
How resolved this problem?
Run-time error '424':
Object recuired
Private Sub Load_Click()
Dim wkbk As Workbook
'
'
With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
Set wkbk = Application.Workbooks.Open( _
Filename:=.list(i, 0), _
Format:=xlCSV, _
Delimiter:=",", _
ReadOnly:=False)
wkbk.Activate
UserForm1.Hide
' Do something
Windows("Smpl.xls").Activate
'Do something
Call UUS ' Included: wbkb.Activate ???Error???
End If
Next i
End With
End Sub
Sub UUS()
wbkb.Activate ???
Range("A1").Select
ActiveSheet.Paste
End Sub
How resolved this problem?