Thread: Similar SaveAs
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Similar SaveAs

You probably want to set LocalFilename = thisworkboo.name at the beginning.
the I would open the files a little diffferent than you arre presently doing

Set wb = Workbooks
wb.Open Filename:="C:\temp\book2.xls"

Then you can get the opened file name with Newfilename = wb.filename.

Now you will know which is the original worksheet Name and the new worksheet
names.

"brownti via OfficeKB.com" wrote:

No i didnt try that. Should i just add that at the begining? Thanks,

Joel wrote:
did you try
MyfileName = thisworkbook.name

It is missing the extension xls. So you may have to add it back.

Below is my code:
Sub report()

[quoted text clipped - 36 lines]
open that started the macro. TEST COPY.xls is a template that all other
files are saved from. the file names will always be different. thanks


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200702/1