View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Save sheet as .TXT out of Workbook

The code copied the worksheet to a new workbook, saved that new workbook and
closed that new workbook.

I'm not quite sure how you could choose this workbook without opening it again.

Ps. The code was placed in the original workbook and that original workbook was
active when I ran the code.

If that isn't the case, then you'll have to fully qualify this reference:

Worksheets("BESPRO MT").Copy

Something like:
Workbooks("myworkbookname.xls").Worksheets("BESPRO MT").Copy

:More confused:







goepf wrote:

Thanks but...

This still doesn't work. This code creates the same problem! Meaning if
I change between my Excel workbooks with "minimize window" (minimize
all the windows and then choose the one I like and maximize it again)
in stead of using the menu "window" this code saves my initial workbook
as a txt file and not the sheet (BESPRO MT) I copied!! very strange!!
It looks like the active window is not the one that I create with my
copy (eventhough it is when not using that minimize / maximize!!)

conclusion:

HELP

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson