Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Run time error 13 with new Collection

Type Mismatch

Stops on Line: "For Each itm In Collection" (says no itm no Collection.)

Any thoughts? Please help
Also why does VB put a space between row and column

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(2, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
bkList.Add Trim(cell.Text), Trim(cell.Text)
Next
On Error GoTo 0

For Each itm In Collection
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Run time error 13 with new Collection

Maybe

For Each itm In bkList

"Tomkat743" wrote:

Type Mismatch

Stops on Line: "For Each itm In Collection" (says no itm no Collection.)

Any thoughts? Please help
Also why does VB put a space between row and column

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(2, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
bkList.Add Trim(cell.Text), Trim(cell.Text)
Next
On Error GoTo 0

For Each itm In Collection
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Run time error 13 with new Collection

Thanks alot I just couldn't see it.

"JMB" wrote:

Maybe

For Each itm In bkList

"Tomkat743" wrote:

Type Mismatch

Stops on Line: "For Each itm In Collection" (says no itm no Collection.)

Any thoughts? Please help
Also why does VB put a space between row and column

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(2, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
bkList.Add Trim(cell.Text), Trim(cell.Text)
Next
On Error GoTo 0

For Each itm In Collection
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection from Range, tag cells on error nowon Excel Programming 1 January 3rd 06 12:34 AM
Can't trap error when checking for keys not in Collection BW Excel Programming 6 August 3rd 05 09:15 PM
Error with passing collection as parameter McManCSU[_17_] Excel Programming 3 August 1st 05 06:19 PM
efficiency qn: search collection or use on error? noel mc Excel Programming 6 November 10th 04 06:19 PM
Runtime error with the sheet collection, which was not there in 20 Laks Excel Programming 1 June 18th 04 11:55 AM


All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"