Excel Crashes on Save after Running Macro

geospatial

Active Member
Joined
Sep 2, 2008
Messages
290
My excel 2007 macro enabled file always crashes when trying to save after running a macro. The VBA I am running is below and it completes fine. Its just after it completes and I go to save the file it crashes.

Code:
Dim folderPath As String
Dim fileName As String
 
Sub master()
 
Dim wb as Workbook
 
folderpath = "C:\Working Folder\2011\"
fileName = Dir(folderPath & "*.xls")
 
Call clear_sigmaster
 
Do while fileName <> ""
Set wb = workbooks.open(folderPath & filename)
 
call importsig
 
fileName = Dir()
 
Loop
End Sub
 
sub clear_sigmaster()
 
Sheets("Sig_Master").Select
Range("A2:GG65536").Select
Selection.Delete Shift:=xlUp
 
End Sub
 
Sub importSig()
 
Windows(filename).Activate
Sheets("Sigacts").Select
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Range("A1:AQ65536").Select
Selection.Copy
Windows("Sigacts 2011.xlsm").Activate
Sheets("Paste_Here").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1").Select
Windows(fileName).Activate
ActiveWindow.Close
Sheets("Sig_Master").Select
Range("A1").Select
Sheets("Paste_Here").Select
Range("A1").Select
Range(Range("AQ65536").End(xlUp), "A2").Copy Sheets("Sig_Master").Range("A65536") _
.End(xlUp).Offset(1,0)
Sheets("Paster_Here").Cells.Clear
 
End Sub
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top