On Error Message skip problem.

ljubo_gr

Active Member
Joined
Dec 6, 2014
Messages
251
Office Version
  1. 2013
Platform
  1. Windows
Hello, dear MrExcel!

I have problem with error message, it shows whether or not is error, how to fix it?
Thank you for your time, thanks in advance kind people!

Code:
Sub Ispis_Izvještaja()
        Dim DP As Dialog
        On Error GoTo Greh
        Application.ScreenUpdating = False
        Set DP = Application.Dialogs(xlDialogPrinterSetup)
        With DP
            If .Show = -1 Then
                ThisWorkbook.Worksheets("List1").Range("d1").PrintOut Preview:=False
                ThisWorkbook.Worksheets("Visine").Range("H1").Select
            Else
                Exit Sub
            End If
        End With
        Exit Sub
Greh:
    MsgBox "NIJE IZAŠLO! PROVJERI PRINTER!"
End Sub
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
There must be an error if you see the message. Probably because you try to select a range on Visine without selecting that sheet first. Try changing this line:

Code:
ThisWorkbook.Worksheets("Visine").Range("H1").Select

to this:

Code:
Application.Goto ThisWorkbook.Worksheets("Visine").Range("H1")
 
Upvote 0
THANKS RORY!!
Actually, me dumb! Visine is from another workbook, i did.t notice! Sorry. Can you help me, after running code excel turns Calculation to manual inside wbook, I checked Application.Calculation = xlCalculationManual, this i have at beggining and at end of code. Maybe, before running excel is set to manual and after my code is again manual??
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top