+ Reply to Thread
Results 1 to 16 of 16

Code Seems Broken Since Beginning Of Month

  1. #1
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Code Seems Broken Since Beginning Of Month

    Good Morning,
    I have a code that converts a sheet to .pdf then opens Outlook for me to send an email.
    Body of the email is a few lines and a "snapshot" of selected cells, also with an attachment of the sheet in .pdf form.
    As of 01Jun, the worksheet seems to be broken. It no longer opens Outlook to send the email. I'm also getting a ":424 Run Time Error" now that wasn't there before.
    Now, I, by no means, am an expert at this, but I am able to limp my way through it. And I can not find what the issue is. I have made multiple changes to no avail.
    Below is the code, any help would be greatly appreciated.
    NOTE: This is not my code, nor is it the person who created the workbook (looks like a template), but it had worked for years.

    Thank you for your assistance!

    Please Login or Register  to view this content.
    Last edited by JFJ; 06-14-2019 at 01:11 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Code Seems Broken Since Beginning Of Month

    At which line do you get the error?

    Also, I'd recommend uploading sample workbook with full code. Without it bit hard to pinpoint the cause.

    Looking at what you posted, there's two object variables... OutlApp and Out1App...
    Reset of your code only uses latter. So, if Outlook was already open when the code executes... it will likely produce that error.

    Try replacing latter with former for all instances.

    FYI - Please use code tag (# button) when posting codes.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    Quote Originally Posted by CK76 View Post
    At which line do you get the error?

    Also, I'd recommend uploading sample workbook with full code. Without it bit hard to pinpoint the cause.

    Looking at what you posted, there's two object variables... OutlApp and Out1App...
    Reset of your code only uses latter. So, if Outlook was already open when the code executes... it will likely produce that error.

    Try replacing latter with former for all instances.

    FYI - Please use code tag (# button) when posting codes.
    Thank you for the response.
    I misspoke earlier as I am getting a "424:Object Required" error on the following line:

    Please Login or Register  to view this content.
    I can post the whole code, but I'm sorry as I'm not familiar with where/how to do it on this forum without just copying it in to a reply.
    Last edited by JFJ; 06-14-2019 at 01:12 PM.

  4. #4
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Code Seems Broken Since Beginning Of Month

    change this line:

    Please Login or Register  to view this content.
    to this:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Code Seems Broken Since Beginning Of Month

    To upload a file...
    Use "Go Advanced" button and follow "Manage Attachments" hyperlink. It will launch new tab/window for managing uploads.

  6. #6
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    dmcgov,

    Forgive me, but what is the difference between these two?

  7. #7
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    Code is under "Daily Report" (sheet 1)
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Code Seems Broken Since Beginning Of Month

    @jfj

    the first line says Out"l"App and that is an L in the quotes
    the second line says Out"1"App and that is a One in the quotes

  9. #9
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    Quote Originally Posted by CK76 View Post
    To upload a file...
    Use "Go Advanced" button and follow "Manage Attachments" hyperlink. It will launch new tab/window for managing uploads.
    Thank you!

  10. #10
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    dmcgov,

    Thank you, I see what you mean.
    That is now corrected but I am getting a "Object Variable or With Block Variable Not Set" error

  11. #11
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Code Seems Broken Since Beginning Of Month

    which line in the debugger is highlighted. i downloaded your workbook, changed OutlApp to Out1App and it worked (in that im getting no error's and the email popped up with the pdf attached)

  12. #12
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Code Seems Broken Since Beginning Of Month

    I tested your file with recommendation I made in post #2. It worked fine.

    0.JPG


    See attached.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    Ok, Well that changes things.
    When I run the code, it doesn't highlight, but the cursor stops on the line that I pointed at.
    I also ran the code that was uploaded again, and it did the same thing. This my be more a OS issue than an excel issue.
    Attached Images Attached Images
    Last edited by JFJ; 06-14-2019 at 02:57 PM.

  14. #14
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Code Seems Broken Since Beginning Of Month

    That error means that you forgot to close With... statement with End With, or If with End If etc.

    Did you use the file I uploaded without altering it?

  15. #15
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    Yes sir, I did. With the same result. That is why i felt like it was no longer an Excel issue.
    After digging in with my IT group, we found that they had implemented a new security program at the beginning of the month that "blacklisted" this particular excel sheet on this computer.
    I'm sorry for wasting ya'lls time on this when it had nothing to do with the code, but I appreciate your assistance and your patience.

    Thanks again.

  16. #16
    Registered User
    Join Date
    06-14-2019
    Location
    Williamsport, PA
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Code Seems Broken Since Beginning Of Month

    Ok, I may have spoke too soon, but I did go check the With and End With and it is there. I did try on the file that you uploaded (no altering) and it's giving me the same message. My IT said they Whitelisted the file, but I don't see a change.

+ 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. Carryover End of Month Balance at Beginning of Each Month
    By cjrube3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-01-2016, 05:04 PM
  2. [SOLVED] WORKDAY + Beginning of Month!
    By Keibri in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-23-2016, 05:09 PM
  3. [SOLVED] Reference to row at beginning of month?
    By Carson Dyle in forum Excel General
    Replies: 5
    Last Post: 11-12-2016, 03:54 PM
  4. [SOLVED] Calculation of days per month for dates beginning in one month and ending in another month
    By Fahrettin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2015, 04:52 PM
  5. [SOLVED] Beginning of Month Function
    By mycon73 in forum Excel General
    Replies: 2
    Last Post: 12-03-2012, 01:19 AM
  6. VB Help - Month Beginning Month End Variable
    By Jonesey_MFC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2012, 11:13 AM
  7. Default to beginning of month
    By Heather in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-22-2005, 05:06 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