Hello,
I'm using the code below to save sheets with colored tab as pdf to a location the can choose themself.
The code is activated by a CmdBtn
So when button clicked, the standard MSO "save a"s screen opens ( see pictures also please)
When users hit cancel or X button, i get an error.
Logical i think while user interrupts the code.
Is it possible to get a message instead( something like " aborted by user" ) and at least the last part of the code is executed( hiding the colored TABS again.
Many thx already
I'm using the code below to save sheets with colored tab as pdf to a location the can choose themself.
The code is activated by a CmdBtn
So when button clicked, the standard MSO "save a"s screen opens ( see pictures also please)
When users hit cancel or X button, i get an error.
Logical i think while user interrupts the code.
Is it possible to get a message instead( something like " aborted by user" ) and at least the last part of the code is executed( hiding the colored TABS again.
Many thx already
VBA Code:
Public Sub TabDuoCreate_PDFs()
'Maakt van alle duo een pdf van het overzicht
Application.ScreenUpdating = False
Call Unhide_Colored_Tabs36Duo
Dim Folder_Path As String
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Selecteer de gewenste folder"
If .Show = -1 Then Folder_Path = .SelectedItems(1)
End With
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Tab.ColorIndex = 36 Then
ws.ExportAsFixedFormat xlTypePDF, Folder_Path & Application.PathSeparator & ws.Name & ".pdf"
End If
Next
Call Hide_Colored_Tabs36Duo
MsgBox "All vieuws duo saved I guess"
End Sub