+ Reply to Thread
Results 1 to 3 of 3

VBA to send range/sheet in the body while workbook is inactive

  1. #1
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    VBA to send range/sheet in the body while workbook is inactive

    Hello all,

    Currently I'm running with a script that sends ranges to the list of recipients. Unfortunately I have discovered that this can be done only while workbook is active as script is selecting the range. If macro runs at scheduled time and workbook is inactive, outlook and excel crashed and requires to be closed through task manager. I would like my spreadsheet to send emails while its inactive, that means while I'm using different spreadsheet or have browser up. Ideally I would like my contents to appear in the body of the email. Please find the macro that I'm using now below:

    Any suggestions guys?

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA to send range/sheet in the body while workbook is inactive

    Hi,

    One way would be to have the send_updates procedure reactivate the workbook that contains the procedure. So as the first line add

    Please Login or Register  to view this content.
    and in the procedure name add st as the variable. i.e.

    Please Login or Register  to view this content.

    Then have the Ontime macro pass the workbook name. i.e.

    Please Login or Register  to view this content.
    Note that the single quotes around the whole calling procedure/wb name and double quotes around the workbook name are vital.
    Last edited by Richard Buttrey; 01-08-2017 at 06:31 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Re: VBA to send range/sheet in the body while workbook is inactive

    Seems to be I have resolved the issue.

    Please Login or Register  to view this content.
    workbook name
    module name where is macro stored that i want to run
    macro that im calling

    Please Login or Register  to view this content.

+ 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. [SOLVED] Place workbook information in body of outlook email but not send it.
    By aliciaward1001 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2015, 08:55 AM
  2. [SOLVED] VBA code to send selected range in body of mail
    By forfiett in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-17-2014, 05:29 AM
  3. Send Sheet as an attachment and Use Range as Body
    By moxman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2013, 02:56 AM
  4. [SOLVED] Send Email 1 sheet as attachment and other sheet as body of emial.
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-19-2013, 02:57 AM
  5. [SOLVED] Send range to email body
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-01-2012, 05:59 PM
  6. Send current sheet as message body
    By imdl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2011, 01:38 AM
  7. send excel work sheet as the body of email.
    By c_worc in forum Excel General
    Replies: 1
    Last Post: 11-11-2005, 12:20 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