title: what wrong with this code?. Converting VBA to VB.Net
body: <p>I would like to ask if someone can help me with this.
  I have this code that Unload a CorelDRAW Macro project a get the new one from the network in order to became easier to update several machines.
  VBA code:</p>
  <pre><code>Sub CDRMacroUpdate()
  ' Unloads the project from CorelDRAW
      GMSManager.Projects(&quot;Project1&quot;).Unload
      Dim nMacro As String
  ' The project have the same name, but it's a new file, here is in the C drive, but it's located in the network folder
      nMacro = &quot;C:\Project1.gms&quot;
  ' Loads the new file and copy to the User GMS folder
      GMSManager.Projects.Load nMacro, True, False
  End Sub
  </code></pre>
  <p>Now I'm trying to convert this VB.Net but I'm getting a lot of errors and I can't see what I'm doing wrong.</p>
  <p>In a form with a Button I have this code:
  I'm using SharpDevelop</p>
  <pre><code>Imports Corel.Interop.VGCore
  Public Partial Class MainForm
      Public Sub New()
          ' The Me.InitializeComponent call is required for Windows Forms designer support.
          Me.InitializeComponent()
      End Sub
      
      Sub BtnUpdateMacroClick(sender As Object, e As EventArgs)
          Dim GMSManager As Corel.Interop.VGCore.GMSManager
          GMSManager.Projects(&quot;Project1&quot;).Unload 
          Dim nMacro As String
          nMacro = &quot;C:\Project1.gms&quot;
          GMSManager.Projects.Load(nMacro, True, False)
  
      End Sub
  End Class
  </code></pre>
  <p>Now, can someone please explain what I'm doing wrong in the VB.Net code?</p>
  <p>Thank very much for the help.</p>