An object variable can be Nothing, a numeric variable cannot, so the If makes no sense.

Try this modification:

Dim x As Long  '' Longs are preferable to Integers
x = Worksheets("VIVA GRAPH").Range("PPTSlide").Value  '' Use .Value, don't rely on default properties
If x > 0 and x < 5 Then  '' explicitly set limits