VBA Autocad_Plot style

To turn on and off Plot style in autocad.
Public Sub DPS_Off()
Dim acadobj As ThisDrawing
Dim MyLayout As AcadLayout
Dim i As Integer
    Set MyLayout = Nothing
    For i = 0 To ThisDrawing.Layouts.Count - 1
    Set MyLayout = ThisDrawing.Layouts(i)
'        MyLayout.ShowPlotStyles = True
'         MyLayout.ShowPlotStyles = True
         MyLayout.ShowPlotStyles = False
       
    Next
MyLayout.ScaleLineweights = True
    ThisDrawing.Regen (acAllViewports)
End Sub
Public Sub DPS_On()
Dim acadobj As ThisDrawing
Dim MyLayout As AcadLayout
Dim i As Integer
    Set MyLayout = Nothing
    For i = 0 To ThisDrawing.Layouts.Count - 1
    Set MyLayout = ThisDrawing.Layouts(i)
'        MyLayout.ShowPlotStyles = True
         MyLayout.ShowPlotStyles = True
'         MyLayout.ShowPlotStyles = False
       
    Next
    ThisDrawing.Regen (acAllViewports)
End Sub