View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bryan Patrick Bryan Patrick is offline
external usenet poster
 
Posts: 1
Default want to save a copy as text , not save the original as text


Hi Helmut,

I have a similar need (on WindowsXP with Excel2003) except I want the text
copy to be saved automagically whenever the .xls file is saved. I tried
playing around with Workbook_BeforeSave(), but I couldn't get it to work.

Would you mind showing me how to do it correctly?

Kind regards,

Bryan Patrick
Batavia, IL, USA

Hi Janis,

try this:

Sub Macro1()
ActiveWorkbook.SaveAs _
Filename:="c:\test\test.txt", FileFormat:=xlTextMac
' now save again as Excel-File
ActiveWorkbook.SaveAs _
Filename:="c:\test\test.xls", FileFormat:=xlWorkbookNormal
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"