Convert VBA to Google app Script
Show
Before you beginYou might want to update incompatible APIs in your VBA code before you convert your files. For files that have the status Supported exactly, you can proceed to Step 1: Convert your files. Modify incompatible VBA APIsFor files that have the status Supported with workaround or Needs investigation, you can apply your workarounds and fixes after the conversion in Apps Script, but we recommend that you modify the VBA code that you’re familiar with first, before you convert your files. For each API marked as Supported with workaround or Needs investigation in the compatibility report, we recommend the following:
Step 1: Convert your files
Step 2: Test your converted filesRun your Apps Script codeAfter you convert your files, test the Apps Script functions. Test the converted files with the data you normally use with your Excel files. If possible, compare the output of your converted Sheets files with the output of your original Excel files. Test your triggersIf your files contain triggers like
Review ReadMe filesIf a ReadMe file was generated with your converted file, review the conversion issues listed within the ReadMe file.
Step 3: Fix errorsIf you run into errors while testing your files, see Fix errors in your converted code. If the code runs without errors, but the result isn’t what you expected, open the file’s ReadMe file. Review each section to help determine what’s causing the issue and apply the recommended fix. After you fix errors, test the file again to make sure everything works as intended. Related articles
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Last updated 2021-01-29 UTC. [{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }] How do I convert a VBA macro to a Google script?Step 1: Convert your files. On your computer, open Google Drive. On the right side panel, click the Macro Converter add-on. ... . Step 2: Test your converted files. Run your Apps Script code. ... . Step 3: Fix errors. If you run into errors while testing your files, see Fix errors in your converted code.. Is Google Apps Script like VBA?VBA is to Office as Google Apps Script is to Google Apps. Those tasks to automate repetitive sequences, or extend the functionality of Office can usually be done in Google Apps Script.
Can I convert an Excel macro to Google Sheets?You can convert macros in Microsoft Excel spreadsheets to Google Sheets by re-creating them using Google Apps Script. Apps Script powers macros in Sheets, just like Microsoft Visual Basic for Applications does for Excel.
Does Google Drive support VBA?Google Sheets does not support VBA -- which stands for Visual Basic for Applications, a Microsoft language derived from Visual Basic. What Sheets does support is Javascript functions working just as macros.
|