Hi guys!
As usual, I've been playing around with this teeny bit of code for a while now and have hit a wall.
I fix one part, just to have another complain....and I know it's not even a complex bit of code!!
At present it's complaining that the save as method has failed, although this worked until a few moments ago.
Could I ask one of you gentlemen to have a look and see where todays screw up has arrived from?
In short, this is supposed to:
1. select the appropriate sheet
2. copy it to it's own workbook
3. save it to a specific file path & a file name designated by cell C4
4. print itself out
5. open an e-mail dialog box and attach the file
6. politely close the copy spreadsheet before returning you to the original workbook.
Simple enough...or so I thought...
Any guidance, wisdom or otherwise support would be greatly welcomed
Phel x
PS - This is an old workbook that someone else built and I'm trying to make fit a new process. I know that it's a really awful way of doing this, but it's what I've got to work with!!
[VBA]
Private Sub Command Button 1_Click()
Dim fname As String
Sheets("4series - fees").Select
Sheets("4series - fees").Copy
fname = "C:\Services\People" & "\" & Range("C4").Value
ActiveWorkbook.SaveAs Filename:=fname
Application.Dialogs(xlDialogSendMail).Show
ActiveWorkbook.PrintOut
ActiveWorkbook.Close
Windows("automated forms 2008.xls").Activate
Sheets("INPUT SHEET").Select
End sub
[/VBA]