Ptech
05-15-2008, 01:36 PM
Hello
I have this program that I collect data for service call and when I'm done. I save files as .xls but separate the reports from the invoice. On this specific page. I click "Save" to save the report and another button to save invoice. They will not work one after another, either or but not after each other. I know it's has to be a simple mistake but I'm stumped. Here's the code.
Private Sub InvoiceSave_Click()
Do
Sheets(Array("Invoice")).Copy
fname = Application.GetSaveAsFilename(Range("AX2").Text + " " _
+ Range("F12").Text + " " + Range("AL13").Text + " " _
+ Format(Range("AX1").Text, "yymmdd") + " Invoice", "Excel Files (*.xls), *.xls,All Files (*.*),*.*")
Loop Until fname <> ""
ActiveWorkbook.SaveAs fname
End Sub
Private Sub SaveReport_Click()
Do
Sheets(Array("Maintenance Data Sheet", "Field Activity Report", "Extended Note")).Copy
fname = Application.GetSaveAsFilename(Range("AX2").Text + " " _
+ Range("F12").Text + " " + Range("AL13").Text + " " _
+ Format(Range("AX1").Text, "yymmdd"), "Excel Files (*.xls), *.xls,All Files (*.*),*.*")
Loop Until fname <> ""
ActiveWorkbook.SaveAs fname
End Sub
Please post Excel questions, in the Excel forum.
Please use the .. tags when you post your code. Edit or reply to this post to see how.
Thank you.
I have this program that I collect data for service call and when I'm done. I save files as .xls but separate the reports from the invoice. On this specific page. I click "Save" to save the report and another button to save invoice. They will not work one after another, either or but not after each other. I know it's has to be a simple mistake but I'm stumped. Here's the code.
Private Sub InvoiceSave_Click()
Do
Sheets(Array("Invoice")).Copy
fname = Application.GetSaveAsFilename(Range("AX2").Text + " " _
+ Range("F12").Text + " " + Range("AL13").Text + " " _
+ Format(Range("AX1").Text, "yymmdd") + " Invoice", "Excel Files (*.xls), *.xls,All Files (*.*),*.*")
Loop Until fname <> ""
ActiveWorkbook.SaveAs fname
End Sub
Private Sub SaveReport_Click()
Do
Sheets(Array("Maintenance Data Sheet", "Field Activity Report", "Extended Note")).Copy
fname = Application.GetSaveAsFilename(Range("AX2").Text + " " _
+ Range("F12").Text + " " + Range("AL13").Text + " " _
+ Format(Range("AX1").Text, "yymmdd"), "Excel Files (*.xls), *.xls,All Files (*.*),*.*")
Loop Until fname <> ""
ActiveWorkbook.SaveAs fname
End Sub
Please post Excel questions, in the Excel forum.
Please use the .. tags when you post your code. Edit or reply to this post to see how.
Thank you.