Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I recently posted a question regarding setting up a For each workbook
statement. It it basically working, but I have a follow up question. 1. I have 17 workbooks open at one time. I am attempting to go through each workbook and format the columns to autofit. The code works for 9 of the documents and then stops. This is the code that I am using. Dim wb As Workbook Dim wsheet As Object For Each wb In Application.Workbooks Set wsheet = Worksheets("sheet1") With wsheet Columns("A:AG").Select Selection.Columns.AutoFit ActiveCell.Offset(1, 0).Select End With ActiveWorkbook.Save ActiveWorkbook.Close Next wb 2. I have noticed that the nine workbooks that work are the 9 that show up in the drop down list under the Windows menu. (I'm not sure that has anything to do with it, but that is the way it appears to me.) So my question is: Is there a limit on how many workbooks you can have open and use the For Each method? And if so, how do I get around it? Or is there something wrong with my code? Thanks, Elaine |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet Limit in Workbook | Excel Worksheet Functions | |||
Limit similtaneous users of workbook | Excel Discussion (Misc queries) | |||
Limit on # of worksheets in a workbook | Excel Discussion (Misc queries) | |||
Limit use Of Workbook | Excel Discussion (Misc queries) | |||
Limit on number of Sheets in a Workbook? | Excel Programming |