LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Code Stops Executing

I have code that copies and existing tab into a new spreadsheet then saves
the new spreadsheet. There is code after that that will close the newly
formed spreadsheet and activate the previous spreadsheet. Problem is that
after the code to save the new spreadsheet runs, the code just stops
executing (doesnt continue to close the new file). Furthermore, the new
spreadsheet doesnt get save €“ even though the file name at the top shows
that it was saved. Any help would be appreciated.

'Make a copy of the letter
Sheets("Letter 1").Copy
Sheets("Letter 1").Name = GrpNumber

'Save the workbook €“ variables have been previously defined
ActiveWorkbook.SaveAs FileName:= _
"G:\Filepath.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

ActiveWindow.Close

Windows("Previous File.xls").Activate
Sheets("Letter 1").Select

 
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
Code stops when high lighting (Chips code) ste mac Excel Programming 6 May 2nd 06 01:39 PM
do anybody have a sample code for executing excel macro from vb code?<eom B Deepak Excel Programming 2 September 30th 05 09:59 AM
(trying again...) code stops executing Mark Kubicki Excel Programming 0 December 4th 03 02:00 PM
VBA code stops executing Mark Kubicki Excel Programming 0 December 3rd 03 06:47 PM
Stops executing or keep looping Don Guillett[_4_] Excel Programming 2 September 14th 03 05:25 AM


All times are GMT +1. The time now is 06:26 AM.

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"