From: Brian on
I am trying to get a WorkBook to print from a user Form Control Button. I am
not exactly sure how to get the Print Dialog Box to come up, so I can choose
the printer, Print Rage, Print What, Number of Copies & Print Preview.

The Name of the WorkBook will Change each time, I am not sure how to
acomplish this task.

Control Button = Print_Eng_Spec_12_Click()

This is the save method I am using, So you can see what information is being
saved as the Workbook Name.

' Save Eng Spec 11 Control Button
Private Sub Save_Eng_Spec_11_Click()

Dim strFile As String
Dim bk As Workbook

Set bk = ActiveWorkbook

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile)

If FileToSave = False Then

MsgBox "The Save Method Failed, Eng Spec was not Saved", , "C.E.S."

Exit Sub

End If

End Sub
From: Dave Peterson on
Excel has a dialogs collection that you can use.

I don't think you'd want the 2nd or 3rd ones--since there's a print preview on
the top dialog.

Me.Hide
Application.Dialogs(xlDialogPrint).Show
'Application.Dialogs(xlDialogPrinterSetup).Show
'Application.Dialogs(xlDialogPrintPreview).Show
Me.Show



Brian wrote:
>
> I am trying to get a WorkBook to print from a user Form Control Button. I am
> not exactly sure how to get the Print Dialog Box to come up, so I can choose
> the printer, Print Rage, Print What, Number of Copies & Print Preview.
>
> The Name of the WorkBook will Change each time, I am not sure how to
> acomplish this task.
>
> Control Button = Print_Eng_Spec_12_Click()
>
> This is the save method I am using, So you can see what information is being
> saved as the Workbook Name.
>
> ' Save Eng Spec 11 Control Button
> Private Sub Save_Eng_Spec_11_Click()
>
> Dim strFile As String
> Dim bk As Workbook
>
> Set bk = ActiveWorkbook
>
> strFile = "SPEC " & TEO_No_1.Value _
> & Space(1) & CLLI_Code_1.Value _
> & Space(1) & CES_No_1.Value _
> & Space(1) & TEO_Appx_No_2.Value
>
> bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile)
>
> If FileToSave = False Then
>
> MsgBox "The Save Method Failed, Eng Spec was not Saved", , "C.E.S."
>
> Exit Sub
>
> End If
>
> End Sub

--

Dave Peterson
From: Brian on
Can I be more spec, about what file to print.

Like the open Spec File:

strFile = "SPECL " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value



"Dave Peterson" wrote:

> Excel has a dialogs collection that you can use.
>
> I don't think you'd want the 2nd or 3rd ones--since there's a print preview on
> the top dialog.
>
> Me.Hide
> Application.Dialogs(xlDialogPrint).Show
> 'Application.Dialogs(xlDialogPrinterSetup).Show
> 'Application.Dialogs(xlDialogPrintPreview).Show
> Me.Show
>
>
>
> Brian wrote:
> >
> > I am trying to get a WorkBook to print from a user Form Control Button. I am
> > not exactly sure how to get the Print Dialog Box to come up, so I can choose
> > the printer, Print Rage, Print What, Number of Copies & Print Preview.
> >
> > The Name of the WorkBook will Change each time, I am not sure how to
> > acomplish this task.
> >
> > Control Button = Print_Eng_Spec_12_Click()
> >
> > This is the save method I am using, So you can see what information is being
> > saved as the Workbook Name.
> >
> > ' Save Eng Spec 11 Control Button
> > Private Sub Save_Eng_Spec_11_Click()
> >
> > Dim strFile As String
> > Dim bk As Workbook
> >
> > Set bk = ActiveWorkbook
> >
> > strFile = "SPEC " & TEO_No_1.Value _
> > & Space(1) & CLLI_Code_1.Value _
> > & Space(1) & CES_No_1.Value _
> > & Space(1) & TEO_Appx_No_2.Value
> >
> > bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile)
> >
> > If FileToSave = False Then
> >
> > MsgBox "The Save Method Failed, Eng Spec was not Saved", , "C.E.S."
> >
> > Exit Sub
> >
> > End If
> >
> > End Sub
>
> --
>
> Dave Peterson
> .
>
From: Brian on
Hi Dave,

Nice to here from you again. I hope you had a nice Christmas.

By the way thanks for all your help on this project.

Brian

"Dave Peterson" wrote:

> Excel has a dialogs collection that you can use.
>
> I don't think you'd want the 2nd or 3rd ones--since there's a print preview on
> the top dialog.
>
> Me.Hide
> Application.Dialogs(xlDialogPrint).Show
> 'Application.Dialogs(xlDialogPrinterSetup).Show
> 'Application.Dialogs(xlDialogPrintPreview).Show
> Me.Show
>
>
>
> Brian wrote:
> >
> > I am trying to get a WorkBook to print from a user Form Control Button. I am
> > not exactly sure how to get the Print Dialog Box to come up, so I can choose
> > the printer, Print Rage, Print What, Number of Copies & Print Preview.
> >
> > The Name of the WorkBook will Change each time, I am not sure how to
> > acomplish this task.
> >
> > Control Button = Print_Eng_Spec_12_Click()
> >
> > This is the save method I am using, So you can see what information is being
> > saved as the Workbook Name.
> >
> > ' Save Eng Spec 11 Control Button
> > Private Sub Save_Eng_Spec_11_Click()
> >
> > Dim strFile As String
> > Dim bk As Workbook
> >
> > Set bk = ActiveWorkbook
> >
> > strFile = "SPEC " & TEO_No_1.Value _
> > & Space(1) & CLLI_Code_1.Value _
> > & Space(1) & CES_No_1.Value _
> > & Space(1) & TEO_Appx_No_2.Value
> >
> > bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile)
> >
> > If FileToSave = False Then
> >
> > MsgBox "The Save Method Failed, Eng Spec was not Saved", , "C.E.S."
> >
> > Exit Sub
> >
> > End If
> >
> > End Sub
>
> --
>
> Dave Peterson
> .
>
From: Brian on
Is it possible to be more specific as to which file to print, based on the
file name?

I am really not sure how to do this because the file name will vary. The
only constant will be "Spec" in the name. I was thinking maybe a pop up list
of the documents open with "Spec' in the name and then being able to pick
which one to print.

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value

If you have any ideas on this please tell me.

"Dave Peterson" wrote:

> Excel has a dialogs collection that you can use.
>
> I don't think you'd want the 2nd or 3rd ones--since there's a print preview on
> the top dialog.
>
> Me.Hide
> Application.Dialogs(xlDialogPrint).Show
> 'Application.Dialogs(xlDialogPrinterSetup).Show
> 'Application.Dialogs(xlDialogPrintPreview).Show
> Me.Show
>
>
>
> Brian wrote:
> >
> > I am trying to get a WorkBook to print from a user Form Control Button. I am
> > not exactly sure how to get the Print Dialog Box to come up, so I can choose
> > the printer, Print Rage, Print What, Number of Copies & Print Preview.
> >
> > The Name of the WorkBook will Change each time, I am not sure how to
> > acomplish this task.
> >
> > Control Button = Print_Eng_Spec_12_Click()
> >
> > This is the save method I am using, So you can see what information is being
> > saved as the Workbook Name.
> >
> > ' Save Eng Spec 11 Control Button
> > Private Sub Save_Eng_Spec_11_Click()
> >
> > Dim strFile As String
> > Dim bk As Workbook
> >
> > Set bk = ActiveWorkbook
> >
> > strFile = "SPEC " & TEO_No_1.Value _
> > & Space(1) & CLLI_Code_1.Value _
> > & Space(1) & CES_No_1.Value _
> > & Space(1) & TEO_Appx_No_2.Value
> >
> > bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile)
> >
> > If FileToSave = False Then
> >
> > MsgBox "The Save Method Failed, Eng Spec was not Saved", , "C.E.S."
> >
> > Exit Sub
> >
> > End If
> >
> > End Sub
>
> --
>
> Dave Peterson
> .
>