Author Topic: Help to Convert Excel Macros in VBA to .Net  (Read 2374 times)

0 Members and 1 Guest are viewing this topic.

Vince

  • Newt
  • Posts: 55
Help to Convert Excel Macros in VBA to .Net
« on: May 08, 2018, 01:03:54 PM »
Hi Swamp Members,

I have an Excel file containing VBA macros that extract and format attribute information from AutoCAD drawings in to bill of material quantity takeoffs in Excel.  Is there a way to convert these macros into .Net format....??

Any assistance would be appreciated....!!


Thank you,
Vince

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Help to Convert Excel Macros in VBA to .Net
« Reply #1 on: May 08, 2018, 02:49:37 PM »
Nothing automatic, but it's pretty straightforward. For the most part you can still use the old VBA code but it's a PITA as it's slow. I prefer utilizing the .net API wherever possible, and have a few programs in my toolkit that dump from autocad to excel, it's quite easy to work with. This would require a bit more effort on the development side but IMO it's totally worth it.

Vince

  • Newt
  • Posts: 55
Re: Help to Convert Excel Macros in VBA to .Net
« Reply #2 on: May 14, 2018, 08:36:59 AM »
Hi Will,

Thank you for your response....!!

Do you know anyone who could possibly convert the Excel VBA macros to .Net....??  I can provide the Excel file containing the VBA macros plus the AutoCAD drawing containing the blocks (with attributes) that provide the input to generate the material takeoff reports in Excel. (Then they can utilize them for their personal use)

Any assistance regarding this matter would be appreciated....!!

Regards,
Vince

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Help to Convert Excel Macros in VBA to .Net
« Reply #3 on: May 14, 2018, 01:43:32 PM »
I don't actually know any... but I know of a few that kick around the swamp here when they're not too busy.
Depending on the time commitment I may be of some assistance.

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: Help to Convert Excel Macros in VBA to .Net
« Reply #4 on: May 23, 2018, 12:26:17 AM »
It's really hard to offer any tips without knowing what the nature of the blocks is. Do all the blocks have common attributes? If so you could try writing that data into a collection of a class that has that data structure, then write that collection to Excel. Try this search: https://www.google.com.au/search?q=epplus+LoadFromCollection for some ideas.

Gasty

  • Newt
  • Posts: 90
Re: Help to Convert Excel Macros in VBA to .Net
« Reply #5 on: June 16, 2018, 11:43:59 PM »
Hi,

Excel VBA has very complicated functions to reproduce in any other language, like "copy range and paste range". I had very rough times trying to do a translation from Excel macros/VBA to .NET because very innocent looking functions/procedures in Excel VBA ended up in a actually very complicated .NET code (like "InvertMatrix"). So, you need to show a lot more in order to obtain good advice on code. My advice is to "quote the client" double to 5 fold as you think the time/cost you are thinking.

Gaston Nunez