Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File formatting!
Hello all!
I was trying save a particular sheet in an Excel workbook into a text format. However the user should be able to name his own text file and the Excel macro should save that in a particular folder. I used the following commands for the task. filesaveName = Application.GetSaveAsFilename( _ fileFilter:="Text Files (*.txt), *.txt") If filesaveName < False Then MsgBox "Save as " & filesaveName End If Sheet1.SaveAs FileName:=filesaveName, where here active sheet is sheet1. It is saving the file with the user defined name, but still in an excel format and am not able to open the same using notepad. Any help would be greatly appreciated guys. Thanks. Arun. Iyer Vextec Corp. --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
File formatting!
You are almost there... you are only missing the fileformat property (
file extension does not a file type make.) Sheet1.SaveAs FileName:=filesaveName, FileFormat:=xlTextWindow -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
File formatting!
Have you tried this? I just watched what happened in the macro recorder to
get the xlText flag. Sheet1.SaveAs FileName:=filesaveName, FileFormat:=xlText It looks like there are a lot of alerts you'll have to deal with. If you know what is happening, try application.displayalerts = false before, and = true after. Robin Hammond www.enhanceddatasystems.com "aiyer " wrote in message ... Hello all! I was trying save a particular sheet in an Excel workbook into a text format. However the user should be able to name his own text file and the Excel macro should save that in a particular folder. I used the following commands for the task. filesaveName = Application.GetSaveAsFilename( _ fileFilter:="Text Files (*.txt), *.txt") If filesaveName < False Then MsgBox "Save as " & filesaveName End If Sheet1.SaveAs FileName:=filesaveName, where here active sheet is sheet1. It is saving the file with the user defined name, but still in an excel format and am not able to open the same using notepad. Any help would be greatly appreciated guys. Thanks. Arun. Iyer Vextec Corp. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel file formatting | Excel Discussion (Misc queries) | |||
Formatting .txt File | Excel Discussion (Misc queries) | |||
Re-formatting when saving as HTM file. | Excel Discussion (Misc queries) | |||
Is it possible to link cell formatting in Excel from file to file | Excel Discussion (Misc queries) | |||
Formatting of Data from .CSV file | Excel Worksheet Functions |