What is the best way to transform VBA to a windows VB console application?

Manjunath Marigoudar 21 Reputation points
2022-08-30T08:07:46.23+00:00

I have written a fully working Visual basic script for excel that uses a User form and an excel template to calculate and create another excel sheet. It is working fine.

Now, I am trying to create a VB console application (to be precise, a WinForms project) in visual basic. I started with manually creating the user form in visual studio item by item. Though it can be done, It is going to take a lot of time. Is there a better way to do this? Can we import the same user form and VB script? Can I use the same VBA code to create a WinForms console application? Also, can we use the same VBA code to create WinForms app? or it is mandatory that it should be written in VB.NET syntax?

Developer technologies Visual Basic for Applications
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 47,436 Reputation points
    2022-08-30T09:44:44.197+00:00

    VBA and VB.NET have a similar name, but are very different.
    You can not use the same code/syntax from VBA for VB.NET.
    You also can not "import" parts of the codes or forms, you have to rewrite everything.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.