Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro works if saved in 2003 format

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 mo

Workbooks.Add
Temp.Copy Befo=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 Befo=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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro works if saved in 2003 format

Hi C2Ranches

See this page for more info
http://www.rondebruin.nl/saveas.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"C2Ranches" wrote in message ...
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 mo

Workbooks.Add
Temp.Copy Befo=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 Befo=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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro works if saved in 2003 format

Thank you for your fast response I will give it a try

"C2Ranches" wrote:

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 mo

Workbooks.Add
Temp.Copy Befo=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 Befo=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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro works if saved in 2003 format


I dont even get that far in the macro (SaveAs)€¦.it hangs when I try to copy
the temp workbook into another workbook and doesnt even get to the SaveAs
command yet. It hangs on this command::
Workbook.Add (it opens a workbook here)
Then hangs he:
Temp.Copy Befo=ActiveWorkbook.Sheets(1)

"Ron de Bruin" wrote:

Hi C2Ranches

See this page for more info
http://www.rondebruin.nl/saveas.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"C2Ranches" wrote in message ...
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 mo

Workbooks.Add
Temp.Copy Befo=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 Befo=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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro works if saved in 2003 format

Is the code on my site working for you ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"C2Ranches" wrote in message ...
Thank you for your fast response I will give it a try

"C2Ranches" wrote:

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 mo

Workbooks.Add
Temp.Copy Befo=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 Befo=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.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro works if saved in 2003 format

I finally got it to work. If I do just a Temp.Copy without the
Befo=ActiveWorkbook.Sheets(1), then it runs. I dont know why that would
make a difference.

"Ron de Bruin" wrote:

Hi C2Ranches

See this page for more info
http://www.rondebruin.nl/saveas.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"C2Ranches" wrote in message ...
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 mo

Workbooks.Add
Temp.Copy Befo=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 Befo=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.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro works if saved in 2003 format

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 Befo=ActiveWorkbook.Sheets(1), then
it runs
"Ron de Bruin" wrote:

Is the code on my site working for you ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"C2Ranches" wrote in message ...
Thank you for your fast response I will give it a try

"C2Ranches" wrote:

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 mo

Workbooks.Add
Temp.Copy Befo=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 Befo=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.


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
Error when opening a 2007 template saved in 2003 format from a mac Mover10 Excel Discussion (Misc queries) 2 July 1st 09 09:41 PM
Text box format missing when saved from 2007 to 2003 Itan Charts and Charting in Excel 1 December 4th 08 08:32 AM
Excel Macro works in 2000 but not in 2003 - HELP! [email protected] Excel Programming 1 March 14th 08 01:15 PM
Hide Row macro works in 2002 but not 2003 Gooser555 Excel Programming 3 February 16th 05 10:17 PM
Macro works in 2003, not in '97 CLR[_2_] Excel Programming 5 July 15th 04 01:29 PM


All times are GMT +1. The time now is 03:04 PM.

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

About Us

"It's about Microsoft Excel"