تعیین کنید که آیا ماکروهای VBA سازگار هستند یا خیر
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک فایل اکسل با ماکروهای Visual Basic for Applications (VBA) در صورتی سازگار در نظر گرفته میشود که همه APIهای مورد استفاده در ماکروها معادل مستقیمی در Apps Script داشته باشند. اگر ماکروهای شما کاملاً سازگار نیستند، ممکن است بتوانید راهحلهایی را اعمال کنید یا کد را تنظیم کنید تا با Apps Script کار کنند.
از گزارش سازگاری مبدل ماکرو برای تعیین اینکه آیا میتوانید فایلهای خود را به صورت خودکار تبدیل کنید یا نیاز به انجام تنظیماتی در کد خود دارید، استفاده کنید.
هنگامی که یک گزارش سازگاری ایجاد می کنید، یکی از وضعیت های زیر برای هر یک از فایل ها و API های شما اعمال می شود:
وضعیت | تعریف |
---|
دقیقا پشتیبانی میشه | این فایل ها حاوی API هایی هستند که همگی معادل های مستقیم در Apps Script دارند. |
با راه حل ها پشتیبانی می شود | این فایلها حاوی حداقل یک API هستند که میتواند با راهحلی پشتیبانی شود. |
نیاز به بررسی بیشتر دارد | این فایل ها حاوی حداقل یک API هستند که برای تعیین نحوه ادامه باید آن را مرور کنید. به عنوان مثال، ممکن است یک API معادل وجود نداشته باشد، یا مبدل ماکرو ممکن است API در حال استفاده را تعیین نکرده باشد. |
یک گزارش سازگاری ایجاد کنید
- در رایانه، Google Drive را باز کنید.
- در پانل سمت راست، بر روی افزونه Macro Converter کلیک کنید
. اگر پانل کناری را نمیبینید، در پایین سمت چپ، روی Show side panel chevron_left کلیک کنید. - روی افزودن فایلها و پوشهها کلیک کنید. مبدل ماکرو فقط فایل های اکسل را تشخیص می دهد.
- فایل ها یا پوشه هایی را که می خواهید تجزیه و تحلیل کنید انتخاب کنید و روی Select کلیک کنید. کمتر از 2000 فایل را در یک زمان انتخاب کنید.
- برای تغییر محل ذخیره گزارش سازگاری، روی تغییر edit پوشه مقصد کلیک کنید و پوشه مورد نظر خود را انتخاب کنید. در غیر این صورت، در پوشه MyDrive شما ذخیره می شود.
- روی ایجاد گزارش کلیک کنید.
- وقتی تجزیه و تحلیل کامل شد، روی مشاهده گزارش کلیک کنید.
گزارش سازگاری را مرور کنید
از جزئیات موجود در گزارش سازگاری برای کمک به تصمیم گیری در مورد نحوه انجام تبدیل فایل خود استفاده کنید. گزارش شما شامل بخش های زیر است:
همچنین میتوانید گزارش را بر اساس API به API با استفاده از برگههایی به نام API برای بررسی و APIهایی با راهحلها بررسی کنید.
نحوه ادامه کار را مشخص کنید
در اینجا چیزی است که ما برای هر وضعیت توصیه می کنیم:
وضعیت | توصیه |
---|
دقیقا پشتیبانی میشه | همان منطق APIهای VBA شما در Apps Script قابل تکرار خواهد بود. تبدیل را ادامه دهید . |
با راه حل ها پشتیبانی می شود | شما باید کد بنویسید تا حداقل یک API VBA را با API معادل Apps Script جایگزین کنید. به طور کلی، شما می توانید با تبدیل ادامه دهید. میتوانید بهصورت دستی APIهای VBA که بهعنوان «پشتیبانیشده» علامتگذاری شدهاند، با راهحلهایی قبل یا بعد از تبدیل فایل جایگزین کنید. توصیه می کنیم از قبل تغییرات خود را انجام دهید. |
نیاز به بررسی بیشتر دارد | حداقل یک API قابل تبدیل نیست. بسته به اهمیت آن API در کد شما، ممکن است نتوانید فایل را تبدیل کنید. کسی که کد اصلی VBA را می داند باید ارزیابی نهایی را انجام دهد. اگر تصمیم به تبدیل فایل خود دارید، باید کدی بنویسید تا حداقل یک API VBA را با Apps Script جایگزین کنید. میتوانید بهصورت دستی APIهای VBA را که بهعنوان بررسی نیازها علامتگذاری شدهاند، قبل یا بعد از تبدیل فایل جایگزین کنید. توصیه می کنیم از قبل تغییرات خود را انجام دهید. |
پس از ارزیابی گزارش سازگاری خود، به تبدیل ماکروهای VBA به Apps Script مراجعه کنید.
مقالات مرتبط
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eVBA macros with direct Apps Script equivalents are considered compatible and can be automatically converted using the Macro Converter add-on.\u003c/p\u003e\n"],["\u003cp\u003eThe Macro Converter's compatibility report identifies files as "Supported exactly", "Supported with workarounds", or "Needs more investigation", guiding your conversion strategy.\u003c/p\u003e\n"],["\u003cp\u003eFor files needing workarounds or further investigation, manual code adjustments may be necessary before or after conversion using equivalent Apps Script APIs.\u003c/p\u003e\n"],["\u003cp\u003eThe compatibility report provides detailed analysis at the file and API level to help assess conversion feasibility and required actions.\u003c/p\u003e\n"],["\u003cp\u003eAfter reviewing the report, proceed with file conversion, addressing potential issues as outlined in the documentation.\u003c/p\u003e\n"]]],[],null,["# Determine if VBA macros are compatible\n\nAn Excel file with Visual Basic for Applications (VBA) macros is considered\ncompatible if all APIs used in the macros have a direct equivalent in Apps\nScript. If your macros aren't fully compatible, you might be able to apply\nworkarounds or adjust the code to make them work with Apps Script.\n\nUse the Macro Converter's compatibility report to determine if you can\nautomatically convert your files as-is or if you need to make adjustments to\nyour code.\n\nWhen you generate a compatibility report, one of the following statuses is\napplied to each of your files and APIs:\n\n| Status | Definition |\n|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Supported exactly** | These files contain APIs that all have direct equivalents in Apps Script. |\n| **Supported with workarounds** | These files contain at least one API that can be supported with a workaround. |\n| **Needs more investigation** | These files contain at least one API that you need to review to determine how to proceed. For instance, there might not be an equivalent API, or the Macro Converter might not have determined the API in use. |\n\nGenerate a compatibility report\n-------------------------------\n\n1. On your computer, open [Google Drive](https://drive.google.com/drive/my-drive).\n2. On the right side panel, click the Macro Converter add-on . If you don't see the side panel, at the bottom right, click Show side panel chevron_left.\n3. Click **Add files and folders**. The Macro Converter only recognizes Excel files.\n4. Choose the files or folders you want to analyze and click **Select**. Select fewer than 2,000 files at a time.\n5. To change where your compatibility report is saved, click Change destination folder edit, and select the folder you want. Otherwise, it's saved in your MyDrive folder.\n6. Click **Generate report**.\n7. When the analysis completes, click **View report**.\n\nReview the compatibility report\n-------------------------------\n\nUse the details in the compatibility report to help you decide how to proceed\nwith your file conversion. Your report includes the following sections:\n\n- **Summary**: This sheet gives an aggregated analysis of the compatibility of all submitted files and their APIs.\n- **Files - compatibility**: This sheet lists every file submitted to the Macro Converter with the compatibility status and details of each file.\n- **Files - detailed analysis**: This sheet gives more information about the\n APIs within a file and what actions you can take to successfully convert each\n API. First, from the top dropdown menu, select a file. Then, from the bottom\n dropdown menu, select a status.\n\n | **Note:** If multiple files have the same name, next to the file names, use the unique identifiers to tell the difference between them. You can open the files in Drive and look for the unique identifiers in the URLs: `https://drive.google.com/file/d/\u003cfile_identifier\u003e/view`.\n\nYou can also review the report on an API-by-API basis using the sheets called\n**APIs to investigate** and **APIs with workarounds**.\n\nDetermine how to proceed\n------------------------\n\nHere's what we recommend for each status:\n\n| Status | Recommendation |\n|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Supported exactly** | The same logic from your VBA APIs will be replicable in Apps Script. [Proceed with the conversion](/apps-script/guides/macro-converter/convert-files). |\n| **Supported with workarounds** | You need to write code to replace at least one VBA API with the equivalent Apps Script API. In general, you can proceed with the conversion. You can manually replace the VBA APIs marked as *Supported with workarounds* either before or after you convert the file. We recommend that you [make your changes beforehand](/apps-script/guides/macro-converter/convert-files#modify_incompatible_vba_apis). |\n| **Needs more investigation** | At least one API can't be converted. Depending on the importance of that API in your code, you might not be able to convert the file. Someone who understands the original VBA code should do the final evaluation. \u003cbr /\u003e If you decide to convert your file, you need to write code to replace at least one VBA API with Apps Script. You can manually replace the VBA APIs marked as *Needs investigation* either before or after you convert the file. We recommend that you [make your changes beforehand](/apps-script/guides/macro-converter/convert-files#modify_incompatible_vba_apis). |\n\nAfter you assess your compatibility report, see [Convert VBA macros to Apps\nScript](/apps-script/guides/macro-converter/convert-files).\n\nRelated articles\n----------------\n\n- [Macro Converter add-on overview](/apps-script/guides/macro-converter/overview)\n- [Convert VBA macros to Apps Script](/apps-script/guides/macro-converter/convert-files)\n- [Fix errors in your converted code](/apps-script/guides/macro-converter/fix-conversion-errors)\n- [Address common issues](/apps-script/guides/macro-converter/address-conversion-issues)\n- [Watch Macro Converter tutorials](/apps-script/guides/macro-converter/tutorials)\n- [List of compatible VBA APIs](/apps-script/guides/macro-converter/compatible-vba-apis)"]]