Module modMain Public m_frmMain As frmMain Public Sub Main() m_frmMain = New frmMain ' Enter here Try 'Try and see if params were passed in on the command line before starting the interface If My.Application.CommandLineArgs.Count > 0 Then ' Only process Dim pp As New clsParamsParser pp.ParseParams() If pp.Flatten Then m_frmMain.FixSingle(pp.InputFile, pp.OutputFile, pp.Flatten) ElseIf pp.MakeFillablePDF Then m_frmMain.FillablePDF(pp.InputFile, pp.OutputFile) End If Else Application.Run(m_frmMain) End If Catch ex As Exception End Try End Sub End Module