Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save excel sheet.
Hi,
Can someone help me. I have used the article on "GetSaveAsFilename - Save as .prn - file not writing" and written the following code: varFileName = Application.GetSaveAsFilename("Statement For SRN-" & Master.SRN & "#Date-" & Format(Date, "yyyymmdd") & ".prn", _ "Space Delimited Text (*.prn), *.prn") If varFileName = False Then MsgBox "Problems getting filename for saving the statement" Exit Sub End If ActiveWindow.SelectedSheets.PrintOut To:=intPageTo ActiveWorkbook.SaveAs FileName:=varFileName ActiveWindow.Close False Everything is fine. The only problem is that this process should be repeated for about 500 employees. So if the above code is used then the user has to intervene and save the file 500 times. Is there any way this process can be automated. What I want is that the statement sheet should be printed and then saved as a space delimited text file (that is *.prn). Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save excel sheet.
Hi
Would it be possible to do something like the following For i = 1 to NumberOfEmployee ActiveWorkbook.SaveAs Filename:="C:\TEMP\" & Employee(i) & ".prn", FileFormat:= xlTextPrinter, CreateBackup:=Fals Nex This would allow you to loop through your list of employees and do a "SaveAs" in an automated fasion and have the SaveAs save to a .prn file HTH -Gene |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save excel sheet | Excel Discussion (Misc queries) | |||
Save, save as, page setup dimmed out in unprotected excel sheet? | Excel Discussion (Misc queries) | |||
VBA code to save excel sheet | Excel Discussion (Misc queries) | |||
save from template to excel sheet | Excel Discussion (Misc queries) | |||
save a excel sheet in vba | Excel Programming |