Showing posts with label VBA. Show all posts
Showing posts with label VBA. Show all posts

Wednesday, January 26, 2011

Outlook VBA Macro Cause Close Loop

When developing a macro for Outlook 2007 Visual Basic Editor, part of the macro code caused outlook to close unexpectedly (“Unexpected Error has occurred”) while attempting to load. This meant that I was not able to easily access the macro to fix the issue.

The article Outlook Close Loop - VB Macro Development suggested to adjust the macro security check option via the registry to allow Outlook to open again. This worked, which allow Outlook to open without the error. When prompted to enable or disable macros while loading, I opted to disabled macros. This allowed Outlook to full load, and gave me access to the VB Editor to fix the issue.

Tuesday, April 21, 2009

VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String

VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String

Original Post: 21st April 2009
Updated: 16th March 2010

The following VBScript / VBA function removes special (illegal in file names) characters from a string and returns a clean string. Illegal/special characters are replaced by a space by default, but can be set to replace specific characters with another string/character. The function can be used to remove characters not supported in filenames and directory names of the file system, SharePoint lists, etc.

Tuesday, March 24, 2009

Microsoft Outlook: Calling VBA Class Module function using VBScript

Although it is not recommended by Microsoft (see below), a procedure can be created in VBA (Visual Basic for Applications) and called using VBScript (Visual Basic Scripting Edition). By default, VBA is not initialised disabled when Outlook is started for performance reasons. If Outlook is started and an item opened (containing VBScript which calls a VBA procedure in the ThisOutlookSession Class Module), an error will occur as the required VBA procedure/function will not be available. For procedures to be called from the ThisOutlookSession module, security settings need to be adjusted to allow the macros to run.
To call a VBA procedure in the ThisOutlookSession module from VBScript, create an Outlook.Application object, which will then allow the procedure to be called.
Understood
This website is using cookies. More details