August 11, 2022

SHSU Houstonian Online

Read all latest news headlines from USA, UK and around the world, get today's breaking news and live updates on politics, elections, business, sports, economy,​ …

Microsoft bans VBA macros in Office after user criticism – Computer – News

Perhaps now is the time to consider whether VBA is something you should want. I understand it can be useful in some cases but sometimes there is a better solution. Besides being extremely dangerous, VBA is a dying language. Developers who have to maintain it will become increasingly rare and most programmers will not want to use it:

  • The editor is terrible (I dare not call it an IDE);
  • Debugging is a drama (errors are blurred and thrown somewhere at the bottom of the call stack, making it nearly impossible to find the origin of the error in a large code base);
  • Version control? no! VBA code is stored in strange markup and embedded in the document. You can put the document in version control but that doesn’t show you the changes made in any commit/check in, your only option is to export all files to a folder and put them in version control;
  • The future is uncertain, the runtime (msvbvm) for Windows 98 (!) was developed and maintained at most to work on recent Windows versions, and it is highly likely that MS will pull the plug someday. As a developer, you don’t want to bet on that.

There are alternatives, for example it is quite possible to develop a program in C# that can be used to perform operations on Office documents. Official OpenXML SDK It is open source and if you want to do things with spreadsheets it is Closed It is highly recommended. The only drawback is that you cannot open documents when you want to perform operations with your C# program.

See also  These are the best Chromebooks right now | Technique

You can also do that Not But I’m afraid you’ll run into problems sooner or later: if Microsoft pulls components on VBA, and this is about to happen, you’ll have to look for last-minute developers who have to convert everything to .C# .