Saving a single Worksheet w/o redundant prompts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to save 1 worksheet out of a workbook that contains 5 worksheets.
I've tried several methods but am not able to make something that I'm
completely happy with.

I'm working in Excel 2003 (and 2000) and I've included the meat of my
current thought process below. The problem I'm having is that when the
application goes to close the activewindow (which is a new workbook that I've
copied the target worksheet into) I get a prompt asking me if I want to save
the changes to the new workbook. Regardless of whethere I click yes or no
the new workbook is where it's supposed to be so I know the code is working
up to the Save command. I don't know why I'm being prompted to save it
again. This code will reside on someone elses machine and I don't want the
redundant Save dialogue box to appear.

Here's the code:

Sheets("WB3 Data").Select
Sheets("WB3 Data").Copy
ActiveWorkbook.SaveAs Filename:= _
"C:\testsave.csv", FileFormat:=xlCSV, CreateBackup:=False
ThisWorkbook.Saved = True
ActiveWindow.Close


Thanks...
 
Try:

Sheets("WB3 Data").Copy
ActiveWorkbook.SaveAs Filename:= _
"C:\testsave.csv", FileFormat:=xlCSV, CreateBackup:=False
ActiveWindow.Close False

Hope this helps
Rowan
 
Thanks. That seems to have done the job.



Rowan Drummond said:
Try:

Sheets("WB3 Data").Copy
ActiveWorkbook.SaveAs Filename:= _
"C:\testsave.csv", FileFormat:=xlCSV, CreateBackup:=False
ActiveWindow.Close False

Hope this helps
Rowan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top