• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Start Outlook using a different VBA Project file

Slipstick Systems

› Developer › Start Outlook using a different VBA Project file

Last reviewed on February 8, 2018     3 Comments

Applies to: Outlook 2016 (Win), Outlook 2013, Outlook 2010

I am trying to use the Outlook 2016 command line switch "/altvba " to start Outlook with its "VbaProject.OTM" macro file in a non-standard location instead of "%appdata%\Microsoft\Outlook", but it does NOT work. When I try to use it, I receive an error message that this switch is not valid.

Correct, you can start Outlook using the /altvba switch to use a different VBA project file... but before you use use the switch, you need to set a registry key to enable this capability.

To use this switch, open the Run command by pressing Windows key + R then type outlook /altvba and the path to the alternate VBA file. You'll need to use double quotes around the path if the path contains spaces. Examples:

outlook /altvba C:\Users\slipstick\AppData\Roaming\Microsoft\Outlook\New.OTM
outlook /altvba "C:\Users\slipstick\Documents\VbaProject.OTM"

use the /altvba switch to start outlook using a different vba project file

The project name is visible in the VBA Editor, but not the full path to the file. Note: if you use VBAProject as the file name (but in a different path), you'll only see the project name, not the full path to the file.

Active VBA project name

Outlook 2016

HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security
DWORD: EnableAltVba
Value: 1

Outlook 2013

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security
DWORD: EnableAltVba
Value: 1

Outlook 2010

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security
DWORD: EnableAltVba
Value: 1

Do it for me

If you don't want to edit the registry, you can download and run the reg file for your version of Outlook.
Outlook 2016 Outlook 2013 Outlook 2010

Start Outlook using a different VBA Project file was last modified: February 8th, 2018 by Diane Poremsky

Related Posts:

  • Disable the Unsafe Hyperlink Warning when Opening Attachments
  • Run-a-Script Rules Missing in Outlook
  • Change Outlook's Programmatic Access Options
  • Embedded Objects are Blocked in Outlook Items

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
3 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Hornblower409 (@guest_219693)
September 4, 2022 1:43 pm
#219693

I think there might be a very minor issue with the section:

"The project name is visible in the VBA Editor, but not the full path to the file. Note: if you use VBAProject as the file name (but in a different path), you'll only see the project name, not the full path to the file."

Testing with my Outlook 2010 I found that:

1) It never displays the full PATH. Only the file NAME.

2) It only displays the Project Name (if the file name is not "VBAProject.otm" and regardless of the location) until you do a Save in the editor. It then reverts to the file name.

0
0
Reply
Dmundt (@guest_215280)
May 28, 2020 12:46 pm
#215280

This is an old post, but I still found it very useful. I can now load files I am developing, and leave my original in tact, great tip!

0
0
Reply
Darren Fletcher (@guest_212396)
December 11, 2018 5:49 am
#212396

Hi,

Hoping you can help. The above worked well for me so thank you for that.

However, it doesn't appear to work fully the first time I run outlook using this. Although it will display the alternative project, only after closing and using the switch again will it actually RUN the code within it.

(my code sets a few things on application_startup, and appends to a text file when both sending and receiving an email)

This is also the case when I replace the file in the AppData/etc.../ folder manually, so isn't specific to using the switch. Just hoping you have some wisdom to help with my issue!

My fingers are crossed, hope you can help!

Thanks
Darren

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 28 Issue 27

Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Subscribe to Exchange Messaging Outlook






Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • How to Remove the Primary Account from Outlook
  • Adjusting Outlook's Zoom Setting in Email
  • Move an Outlook Personal Folders .pst File
  • Save Sent Items in Shared Mailbox Sent Items folder
  • Remove a password from an Outlook *.pst File
  • Outlook Auto Account Setup: Encrypted Connection not available
  • This operation has been cancelled due to restrictions
  • Create rules that apply to an entire domain
  • Use PowerShell to get a list of Distribution Group members
  • Outlook SecureTemp Files Folder
  • How to Block Foreign Spam
  • Automatically Open New Outlook when Windows boots
  • Block External Content in New Outlook
  • Save Messages in New Outlook
  • Send Individual Messages when Sending Bulk Email
  • Centrally managed signatures in Office 365?
  • Create a rule to delete spam with no sender address
  • Open Outlook Folders using PowerShell or VBScript
  • Cannot add Recipients in To, CC, BCC fields on MacOS
  • Change Appointment Reminder Sounds
Ajax spinner

Newest Code Samples

Delete Old Calendar Events using VBA

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

Format Images in Outlook Email

Set Outlook Online or Offline using VBScript or PowerShell

List snoozed reminders and snooze-times

Search your Contacts using PowerShell

Filter mail when you are not the only recipient

Add Contact Information to a Task

Process Mail that was Auto Forwarded by a Rule

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in Outlook for Windows.

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




Windows 10 Issues

  • iCloud, Outlook 2016, and Windows 10
  • Outlook Links Won’t Open In Windows 10
  • Outlook can’t send mail in Windows 10: error Ox800CCC13
  • Missing Outlook data files after upgrading Windows?

Outlook Top Issues

  • The Windows Store Outlook App
  • The Signature or Stationery and Fonts button doesn’t work
  • Outlook’s New Account Setup Wizard
  • Outlook 2016: No BCM
  • Exchange Account Set-up Missing in Outlook 2016

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Contact Tools

Data Entry and Updating

Duplicate Checkers

Phone Number Updates

Contact Management Tools

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2023 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment