Phelony
09-24-2009, 06:47 AM
Hi guys! :hi:
As usual, I've been playing around with this teeny bit of code for a while now and have hit a wall. :banghead:
I fix one part, just to have another complain....and I know it's not even a complex bit of code!! :bug:
At present it's complaining that the save as method has failed, although this worked until a few moments ago. :doh:
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 :bow:
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!!
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
As usual, I've been playing around with this teeny bit of code for a while now and have hit a wall. :banghead:
I fix one part, just to have another complain....and I know it's not even a complex bit of code!! :bug:
At present it's complaining that the save as method has failed, although this worked until a few moments ago. :doh:
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 :bow:
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!!
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