XL97: Error Using "Mailto:" with FollowHyperlink Method

ID: Q161324

The information in this article applies to:

SYMPTOMS

When you run a Visual Basic for Applications macro in Microsoft Excel 97, you may receive one of the following error messages:

   Run-time error '-2146697203 (800c000d)':
   Method 'FollowHyperlink' of object '_Workbook' failed

   -or-

   Run-time error '-2146697203 (800c000d)':
   The required Internet protocol is not installed on your computer, or
   the Internet address you requested may not be valid.

and the macro halts.

CAUSE

This problem occurs when all of the following conditions are true:

RESOLUTION

To resolve this problem, do not set the value of the Method argument to "msoMethodPost" when the Address argument contains a "mailto:" reference.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

In Microsoft Excel 97, you can use the FollowHyperlink method in a Visual Basic macro when you want to view a document or Web page located either on the Internet or on your local intranet. The Address argument of the FollowHyperlink method allows you to specify what document to view. For example, the following code:

   ActiveWorkbook.FollowHyperlink Address:="http://msnbc.com/"

displays the MSNBC home Web page.

However, if the Address argument begins with "mailto:" followed by an e-mail address, Microsoft Excel 97 starts your mail client (for example, Microsoft Outlook 97, or Microsoft Exchange) and instructs your mail client to compose a new mail message that is addressed to the specified e-mail address. For example, running this line of code:

   ActiveWorkbook.FollowHyperlink Address:="mailto:cmitchell@maas.com"

causes your mail client to compose a new mail message that is addressed to cmitchell@maas.com. Note that the new mail message is not sent automatically. You must still click Send to send the message.

If the Address argument refers to an e-mail address, setting the Method argument to msoMethodPost causes one of the error messages described in this article to appear, and the macro halts. For example, the following line of code does not work:

   ActiveWorkbook.FollowHyperlink Address:="mailto:cmitchell@maas.com", _
       ExtraInfo:="Here's the data!", Method:=msoMethodPost

Additional query words: XL97
Keywords          : kbdta KbVBA offinterop 
Version           : WINDOWS:97
Platform          : WINDOWS
Issue type        : kbprb

Last Reviewed: December 9, 1998