J
John Kitchens
SORRY FOR THE LENGTH OF THIS POST!
I am having a problem that I hope I can get resolved here.
I created a file that the user fills out and enters the information.
This file is saved in a folder named for example 091604.
There may be up to 60 or 70 files stored in this folder. Tommorrow the same
process different folder etc. 091704.
I have another form that I saved as a template. When you open this form
there is "Click Here" button. When you click this button the open file box
appears and you can highlight the files that you want to summarize.
All worked fine until I tried to summarize more than 34 files. If you do
less than 34 files it works great. When you have more than 34 ( I will have
60 to 70) you get error messages asking for you to debug etc.
I didn't create the macro. I contacted the person that made it and they sent
me a new form. This macro will open the files that I highlight and delete
any objects that are in the files and also change the font to normal.
THE PROBLEM. All of the individual files I am summarizing are protected. So
it will not work either. I did a sample of 60 files that were unprotected
and it worked properly.
I have no option of having the individual files unprotected. They are filled
out by inexperienced users and there is no way that I can unprotect them.
I am including a copy of the macro here:
Sub GetSheets()
Dim i As Long
Dim varr As Variant
Dim wkbk As Workbook
Dim ws As Worksheet
Application.DisplayAlerts = False
varr = Application.GetOpenFilename(filefilter:="Excel Files, *.xls", _
MultiSelect:=True)
If IsArray(varr) Then
For i = LBound(varr) To UBound(varr)
Set wkbk = Workbooks.Open(varr(i))
Set ws = wkbk.Sheets("Sheet1")
ws.Name = Left(wkbk.Name, Len(wkbk.Name) - 4)
ws.Cells.Style = "Normal"
ws.DrawingObjects.Delete
ws.Copy After:=ThisWorkbook.Worksheets("Start")
wkbk.Close SaveChanges:=False
Next
End If
Application.DisplayAlerts = True
End Sub
Sub UnhideSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.Visible = xlSheetVisible
Next ws
End Sub
Is there a way that this macro can be changed to tell it to unprotect the
individual files.
I love the way this thing works, I just need to be able to do at least 70
files, and it won't do it with the old macro or with this one unless
protection is turned off. The person that made this macro is on vacaton
until next month. I really can't wait that long.
Please help.
I am having a problem that I hope I can get resolved here.
I created a file that the user fills out and enters the information.
This file is saved in a folder named for example 091604.
There may be up to 60 or 70 files stored in this folder. Tommorrow the same
process different folder etc. 091704.
I have another form that I saved as a template. When you open this form
there is "Click Here" button. When you click this button the open file box
appears and you can highlight the files that you want to summarize.
All worked fine until I tried to summarize more than 34 files. If you do
less than 34 files it works great. When you have more than 34 ( I will have
60 to 70) you get error messages asking for you to debug etc.
I didn't create the macro. I contacted the person that made it and they sent
me a new form. This macro will open the files that I highlight and delete
any objects that are in the files and also change the font to normal.
THE PROBLEM. All of the individual files I am summarizing are protected. So
it will not work either. I did a sample of 60 files that were unprotected
and it worked properly.
I have no option of having the individual files unprotected. They are filled
out by inexperienced users and there is no way that I can unprotect them.
I am including a copy of the macro here:
Sub GetSheets()
Dim i As Long
Dim varr As Variant
Dim wkbk As Workbook
Dim ws As Worksheet
Application.DisplayAlerts = False
varr = Application.GetOpenFilename(filefilter:="Excel Files, *.xls", _
MultiSelect:=True)
If IsArray(varr) Then
For i = LBound(varr) To UBound(varr)
Set wkbk = Workbooks.Open(varr(i))
Set ws = wkbk.Sheets("Sheet1")
ws.Name = Left(wkbk.Name, Len(wkbk.Name) - 4)
ws.Cells.Style = "Normal"
ws.DrawingObjects.Delete
ws.Copy After:=ThisWorkbook.Worksheets("Start")
wkbk.Close SaveChanges:=False
Next
End If
Application.DisplayAlerts = True
End Sub
Sub UnhideSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.Visible = xlSheetVisible
Next ws
End Sub
Is there a way that this macro can be changed to tell it to unprotect the
individual files.
I love the way this thing works, I just need to be able to do at least 70
files, and it won't do it with the old macro or with this one unless
protection is turned off. The person that made this macro is on vacaton
until next month. I really can't wait that long.
Please help.