Macro works if saved in 2003 format

  • Thread starter Thread starter C2Ranches
  • Start date Start date
C

C2Ranches

Does anyone know why this code would work in Excel 2007 as long as it is
saved in 2003 format, but if it is saved in Excel 2007 format it will work
once but not twice or more:

Workbooks.Add
Temp.Copy Before:=ActiveWorkbook.Sheets(1)
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:="C:\HOLDINGS\stipdaily"
ActiveWorkbook.Close
Book.Close


Runs the first time fine, but if you try to run it again, it hangs at:
Temp.Copy Before:=ActiveWorkbook.Sheets(1)
If you save the Macro in 2003 format, it works every time you want to run it.

Thanks ahead of time for any clues you can pass along.
 
I don’t even get that far in the macro (SaveAs)….it hangs when I try to copy
the temp workbook into another workbook and doesn’t even get to the SaveAs
command yet. It hangs on this command::
Workbook.Add (it opens a workbook here)
Then hangs here::
Temp.Copy Before:=ActiveWorkbook.Sheets(1)
 
I finally got it to work. If I do just a Temp.Copy without the
Before:=ActiveWorkbook.Sheets(1), then it runs. I don’t know why that would
make a difference.
 
No it did not. It was hanging before the save as. I finally got it to work.
If I do just a Temp.Copy without the Before:=ActiveWorkbook.Sheets(1), then
it runs
 
Back
Top