+ Reply to Thread
Results 1 to 3 of 3

VBA code works in Excel but not in Outlook

  1. #1
    Registered User
    Join Date
    04-02-2023
    Location
    Cairns, Australia
    MS-Off Ver
    Microsoft 365 MSO (Version 2202 Build 16.0.14931.20272) 64-bit
    Posts
    11

    VBA code works in Excel but not in Outlook

    Hello!
    I developed this code to open a basic dialogue box, you enter the project number, and it opens the project folder.
    This code works perfectly in Excel but fails in Outlook. In Outlook it defaults to the error handler "Not connected to the network" (even though I am connected to the network, so it's just not recognising the directory).
    Any ideas?


    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 05-24-2023 at 10:53 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: VBA code works in Excel but not in Outlook

    Please Login or Register  to view this content.
    Never do this unless you know exactly where the error can occur and what error you anticipate. What you are in fact doing is disabling error handling so you can do it yourself. I'm unclear on why you are doing this.

    Comment out that line of code then tell us which line of code raises the error.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-02-2023
    Location
    Cairns, Australia
    MS-Off Ver
    Microsoft 365 MSO (Version 2202 Build 16.0.14931.20272) 64-bit
    Posts
    11

    Re: VBA code works in Excel but not in Outlook

    Thanks. I asked ChatGPT for suggestions and it was as simple as changing the backslashes to forward slashes in the directory search! Fixed it!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Code Not Pasting data in Outlook from Excel. Only CTRL V works
    By wilfredolagares in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2022, 10:43 AM
  2. Code works for outlook 2010 but not 2013
    By Legend Rubber in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2015, 05:00 PM
  3. Replies: 1
    Last Post: 12-20-2014, 03:36 AM
  4. Excel 2003/Outlook Code Does not Work in Outlook 2010
    By blackscholes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2014, 12:58 PM
  5. Excel/Outlook 2007 vba code doesn't work in Excel/Outlook 2010
    By eveloy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2014, 10:39 PM
  6. Excel/Outlook 2007 vba code doesn't work in Excel/Outlook 2010
    By eveloy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-19-2014, 07:44 PM
  7. [SOLVED] Macro sends Excel file by Outlook - works in debug - not realtime
    By DJL in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2005, 10:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1