+ Reply to Thread
Results 1 to 10 of 10

Outlook Email to Excel

  1. #1
    Registered User
    Join Date
    10-09-2019
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    9

    Outlook Email to Excel

    Hi,

    I was able to run below code however to no avail, the excel file is empty. Can someone help me fix the problem? Why is it that email is not transferring to excel?

    Looking forward for your assistance.
    Attached Images Attached Images

  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,720

    Re: Outlook Email to Excel

    What is it that you expect this code to do?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

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

    Re: Outlook Email to Excel

    Offhand, I see that you have a comment that you save the workbook, but you don't actually save it to the specified path, you just close it.

  4. #4
    Registered User
    Join Date
    10-09-2019
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    9

    Re: Outlook Email to Excel

    The new workbook has been saved however, the file is empty when I opened it. I am not sure what went wrong in the code. The macro failed to copy the email as what I wanted in the excel file. Can you please point out what will be the code I should use?

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

    Re: Outlook Email to Excel

    Please post your code instead of a picture of your code. Pictures are not useful for code--we can't copy it to test it, or modify it for you.

    You are creating both an Excel application and and Outlook application in this code, which you never use. Then you create another Excel application. Are you running this code in Outlook or Excel?

    Other than cleaning that up, I would add a line that says

    Please Login or Register  to view this content.
    before you close the workbook.

  6. #6
    Registered User
    Join Date
    10-09-2019
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    9

    Re: Outlook Email to Excel

    Hi,

    Please be advised that the excel automatically save on the shared drive. Hoever, when I open it, the excel file is empty. It seems that the code was not able to read and write the contents from email to excel. Here's the code:
    Please Login or Register  to view this content.
    Thanks in advance.
    Last edited by 6StringJazzer; 10-15-2019 at 10:52 AM.

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

    Re: Outlook Email to Excel

    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

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

    Re: Outlook Email to Excel

    Quote Originally Posted by KMBuild View Post
    Here's the code:
    This code has several compilation errors so it appears it was not copied directly from the VBA module. They are easy to fix, and I will try to reproduce your problem. But it raises the question of other copy errors.
    Last edited by 6StringJazzer; 10-15-2019 at 10:58 AM.

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

    Re: Outlook Email to Excel

    I cannot even run this code because I get a compile error here. I am unclear on how you are getting this to run. GetSharedDefaultFolder has two required arguments.

    typemismatch.JPG

    Also, I asked "Are you running this code in Outlook or Excel?" Since the code calls Application methods in Outlook I am going to assume this code is in Outlook.

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

    Re: Outlook Email to Excel

    This code has many problems in it, especially undeclared variables. I have fixed as many as I could to get it to run, but I could not get it to produce an Excel file.

    I am especially having trouble with GetSharedDefaultFolder. I am not familiar with that method and can't get it to work.

    The line

    Please Login or Register  to view this content.
    is a poor practice here because it hides errors. You are almost certainly getting an error that is ignored and that is why your file is blank. I suggest commenting out this line, running it again, and then report back to tell us what error you get.

+ 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. Replies: 3
    Last Post: 03-11-2019, 05:31 PM
  2. Replies: 0
    Last Post: 05-28-2018, 09:53 AM
  3. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  4. export outlook 2007 email into excel with subject and body of email
    By akulka58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2013, 02:37 PM
  5. How to parse data in Outlook email using HTML version of email back to excel
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-31-2012, 02:54 PM
  6. Replies: 2
    Last Post: 08-01-2012, 02:47 PM

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