Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I've got a dialog box with check bo

Status
Not open for further replies.

Jamie2002

Technical User
Sep 17, 2001
62
GB
I've got a dialog box with check boxes on it each relating to a sheet. I want the user to be able to select which pages they want to print then there selection be printed. I have done the following code to make the string of pages to use in the print code but I cant get the ," " to add to each page name so that the Array() will take the variable.

Also I'm having problems with a runtime error 1004 - Method Printout of object Sheets failed ????? Is this because the dialog box is still open and if so how do I solve this.

Thanks.


Sub PrintSelection2()

Dim PrintArray As String
Dim strTemp As String

DialogSheets("Print Menu").Select

If [Check box 6] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ", "
End If
strTemp = strTemp & "Cover"
End If

If [Check box 7] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ", "
End If
strTemp = strTemp & "Contents"
End If

If [Check box 8] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ","
End If
strTemp = strTemp & "Summary"
End If

If [Check box 9] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ", "
End If
strTemp = strTemp & "KPI's - Telephone"
End If

If [Check box 10] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ", "
End If
strTemp = strTemp & "KPI's - Internet"
End If

If [Check box 11] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ", "
End If
strTemp = strTemp & "Graphs"
End If

If [Check box 12] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ", "
End If
strTemp = strTemp & "Margin Analysis - Summary"
End If

If [Check box 13] = 1 Then
If (Len(strTemp) > 0) Then
strTemp = strTemp & ", "
End If
strTemp = strTemp & "Event Analysis"
End If

PrintArray = strTemp

Sheets(Array(PrintArray)).Select
Sheets("Summary").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, collate:=True

End Sub
 
Hi,
Once again...

There are some severe limitations with DialogSheets.

The preferred user interface approch is UserForms.

From a UserForm you CAN PRINT. From a DialogSheet you CANNOT.

Sorry. I don't think that this is what you want to hear. :) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top