Private Python2VBText As New TextBox ' A change to badScope.py avoiding any error by passing a parameter Public Sub main() Dim x As Integer x = 3 f(x) End Sub Public Sub f(x As Object) Python2VBText.Text = Python2VBText.Text +x.ToString + vbNewLine Python2VBText.MultiLine = True Python2VBText.Width = 200 Python2VBText.Height = 100 Form1.Controls.Add(Python2VBText) End Sub 'main()