Microsoft Tools · MIC-42

Advanced VBA Macros in Microsoft Excel

Advanced VBA Macros in Microsoft Excel is an advanced course covering class modules, Excel add-ins with a custom Ribbon tab, safe distribution, and using VBA to create Word documents and PowerPoint slides from Excel data. It suits people who already write intermediate VBA and those who share macros with a team, and you leave able to build your own reporting add-in.

Updated
From 7,200 THB / person 8,000 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration12 hours · 2 days
  • FormatOnsite / live online
  • Next roundOn request
  • CertificateIncluded

Course overview

Once the macros you write are used by several people, the problems change. Users accidentally delete or edit macros, code has to be copied into every file, there is no easy menu to run it, and data still has to be copied from Excel into Word or PowerPoint by hand for every report. Packaging macros as an add-in with your own Ribbon tab, and letting VBA build documents and slides automatically, lets you distribute tools properly and cut repetitive work across programs.

This course starts with structuring a VBA project and using class modules, then turns macros into an Excel add-in (.xlam), builds a Ribbon tab with Ribbon XML and callbacks that change button states, and sets out how to distribute, protect and sign code. You then use VBA to control Word and PowerPoint, creating documents, reading tables from Word and building slides with charts, and review what to know about VBA in Microsoft 365. It finishes with a workshop that builds an add-in producing Word and PowerPoint reports from Excel data. (2 days, 6 hours per day, 12 hours in total, Advanced level.)

What you’ll gain

  • Structure large VBA projects and use class modules
  • Turn macros into an Excel add-in (.xlam) and install it correctly
  • Build a Ribbon tab with Ribbon XML and write VBA callbacks
  • Distribute, protect and update add-ins safely in an organisation
  • Use VBA to control Word, creating documents and reading data back into Excel
  • Use VBA to control PowerPoint, building slides from Excel data and charts
  • Understand the limits of VBA in Microsoft 365 and the right alternatives

Who this course is for

  • People who have completed Excel with VBA for Microsoft 365 or can already write intermediate VBA
  • People who need to share macros with colleagues or several departments
  • Staff who regularly turn Excel data into Word documents or PowerPoint slides
  • IT staff who look after VBA tools in their organisation

Prerequisites

  • Able to write subs and functions that pass arguments
  • Able to use the Excel object model, arrays and dictionaries
  • Able to build UserForms and write error-handling code
  • Able to use Word and PowerPoint at a basic level
  • A Windows laptop with Microsoft 365 apps or Office 2024 (Excel, Word and PowerPoint)

Curriculum

Course Details

This is the 2026 edition of the Advanced VBA macros in Microsoft Excel course. It runs for 2 days, 6 hours per day (12 hours in total, 09:00-16:00), as lectures with hands-on coding labs in every topic, at Advanced level. It keeps the original core of add-ins, Ribbon tabs and controlling Word and PowerPoint, updated for 64-bit Microsoft 365 and Office 2024, and adds class modules, dynamic Ribbons, distribution and code signing, and what to know about VBScript and the new Outlook. It follows on from Excel with VBA for Microsoft 365. Learners use their own or their company's Office for Windows and take home the course handbook, practice files, sample code and the reporting add-in from the workshop.

Day 1 Code Structure, Add-ins and the Ribbon

Section 1: Lab: Structuring a Large VBA Project

  • Splitting modules by purpose, and Option Private Module
  • Enums, user-defined types and constants for system settings
  • A shared error-handling pattern, and exporting modules to back up code
  • Lab: tidy an existing macro project before turning it into an add-in

Section 2: Lab: Class Modules

  • What a class is and how it differs from a standard module
  • Property Get, Let and Set, methods, and storing objects in a collection
  • WithEvents to receive Application events in an add-in
  • Lab: a report data class shared across the system

Section 3: Lab: Building an Excel Add-in (.xlam)

  • How macro workbooks differ from add-in files
  • ThisWorkbook versus ActiveWorkbook in add-in code
  • Saving as .xlam, installing and enabling it through Excel Add-ins
  • Lab: turn the team's macros into an add-in and install it for testing

Section 4: Lab: A Ribbon Tab with Ribbon XML

  • The customUI structure: tab, group, button and imageMso icons
  • Editing customUI in the file with a Ribbon XML editor
  • onAction and callbacks that take IRibbonControl
  • Lab: build a team tab with buttons that run the add-in macros

Section 5: Lab: A Dynamic Ribbon

  • onLoad and keeping the IRibbonUI object for later
  • getEnabled, getLabel and Invalidate to change button states
  • dropDown, checkBox and editBox controls on the Ribbon
  • Lab: buttons that are enabled only when a correctly formatted file is open

Section 6: Lab: Distributing and Maintaining Add-ins Safely

  • Password-protecting the VBA project and the limits of this approach
  • Network trusted locations, and blocked macros in files from the internet
  • Signing code with a digital signature, and delivering new add-in versions
  • Lab: place the add-in in a shared folder and test a version update
Day 2 Controlling Word and PowerPoint, and Workshop

Section 7: Lab: Principles of Cross-Program Automation

  • Early binding through References versus late binding with CreateObject
  • GetObject to use a program that is already open
  • Closing documents, calling Quit and releasing memory correctly
  • Lab: open Word from Excel and close it properly even when an error occurs

Section 8: Lab: Creating Word Documents from Excel

  • Document, Range, and adding text and tables
  • Filling content controls and bookmarks in a template
  • Creating many documents from a list in Excel
  • Lab: produce a letter for each customer from a template and save it as PDF

Section 9: Lab: Reading Data from Word into Excel

  • Looping through tables and cells in a Word document
  • Reading values from content controls in a form
  • Looping through every document in a folder
  • Lab: combine data from many Word forms into an Excel table

Section 10: Lab: Building PowerPoint Slides from Excel

  • Presentation, Slide and Shape in the PowerPoint object model
  • Adding slides based on the layouts of a company template
  • Adding text and tables, and pasting Excel charts onto slides
  • Lab: build branch sales summary slides from Excel data

Section 11: Lab: What to Know about VBA in Microsoft 365

  • 64-bit Office, and Declare with PtrSafe and LongPtr
  • The VBScript deprecation and the RegExp built into VBA
  • The new Outlook does not support VBA, and the alternatives
  • When to choose VBA, Office Scripts or Power Automate
  • Lab: check and update old code to run on 64-bit Office

Section 12: Workshop: An Automated Reporting Add-in

  • Workshop: an add-in with a Ribbon tab to choose the data and month
  • Create a Word report and PowerPoint slides from Excel data in one click
  • Handle errors and log each run
  • A checklist before distributing the add-in in your organisation

Schedule & training options

For individuals — public rounds

No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

How do you turn a macro workbook into an Excel add-in?

Organise the code in an .xlsm file so it refers to ThisWorkbook for the add-in itself and ActiveWorkbook for the file the user has open. Then use File, Save As and choose Excel Add-in (.xlam), and install it via File, Options, Add-ins, choosing Excel Add-ins in the Manage box, clicking Go and ticking the file. In an organisation, place the file in a trusted location or sign the code with a digital signature so the macros are not blocked.

How do you create your own Ribbon tab to run macros?

A tab that travels with an add-in is defined in Ribbon XML (customUI) embedded in the file, describing the tab, groups and buttons, with each button's onAction naming a VBA callback that takes control As IRibbonControl. To enable or disable buttons as conditions change, keep the IRibbonUI object from onLoad and use getEnabled with Invalidate. Adding buttons through Customize Ribbon in Options only affects your own computer.

How do you control Word or PowerPoint from Excel VBA?

Use automation: create the target program with CreateObject("Word.Application") for late binding, or reference the Microsoft Word Object Library under Tools, References for early binding with IntelliSense. Then fill content controls or bookmarks in a template, or use PowerPoint.Application to add slides by layout and paste charts. When finished, close the documents and call Quit even if an error occurs, so the program is not left in memory.

Does old VBA code work with 64-bit Office and current Microsoft 365?

Most code works, but some points need checking. Declare statements that call the Windows API need PtrSafe, with LongPtr for pointer values. Code that references VBScript.RegExp should move to the RegExp built into VBA because VBScript is being deprecated, and code that controls Outlook needs classic Outlook, because the new Outlook does not support VBA.

Who is the Advanced VBA Macros in Microsoft Excel course for, and what should I know beforehand?

It suits people who have completed Excel with VBA for Microsoft 365 or already write intermediate VBA, people who share macros with a team, and staff who regularly turn Excel data into Word or PowerPoint. You should be able to write subs and functions, use arrays and dictionaries, build UserForms and handle errors, and bring a Windows laptop with Microsoft 365 apps or Office 2024.

Can the Advanced VBA Macros in Microsoft Excel course be run in-house for our team?

Yes. It can be run in-house for your team, with examples adapted to your own work, such as an add-in that bundles the team's shared macros with a company Ribbon tab, or Word reports and slides built from your real data. You can request a quotation from this page, or contact us on LINE @itgenius or by phone on 02-570-8449.

Related articles

Articles are published in Thai.