Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I would like to save a sheet as .TXT out of a workbook. This works fine but if: I have several workbooks open and I switched between the workbooks by minimizing them (in stead of using the menu "window") the code doesn't work properly because the copied sheet is not the active sheet and the code will save the original workbook as a .TXT... code: Sheets("BESPRO MT").Select 'sheet to copy and save as .txt Sheets("BESPRO MT").Copy DLSfile = "DL72112.txt" ActiveWorkbook.SaveAs FileName:=path & DLSfile, FileFormat:=xlText, CreateBackup:=False ActiveWindow.Close 'should close dl72112.txt but see problem above... Windows(FileName).Activate Sheets("BESPRO MT").Delete I tried with maximize window and also with activate but it didn't work... any idea? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Please help! When I 'save changes' to my workbook/sheet | Excel Discussion (Misc queries) | |||
Save Sheet as Workbook | Excel Discussion (Misc queries) | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Can I only save one sheet out of the workbook? | Excel Discussion (Misc queries) | |||
Save sheet as .TXT out of Workbook | Excel Programming |