Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save excel sheet ielmrani via OfficeKB.com Excel Discussion (Misc queries) 15 June 24th 08 02:21 PM
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
VBA code to save excel sheet [email protected] Excel Discussion (Misc queries) 1 March 17th 07 04:20 AM
save from template to excel sheet ELZNHS00 Excel Discussion (Misc queries) 0 August 2nd 06 05:51 PM
save a excel sheet in vba Jean-Noel Dotter Excel Programming 4 July 31st 03 06:22 PM


All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"