Results 1 to 6 of 6

Thread: VBS to copy a range of cells and email in an outlook body

  1. #1

    VBS to copy a range of cells and email in an outlook body



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Good Morning KEN,
    I need VBS to copy a range of cells (A1: D13) and email in an outlook body. Please note i need automated scrip that i want to schedule it for daily useage. My sheet is connected with database that updates after 14 hrs and i'll schedule this vbs to send me & my team dashboard ( Cell ranges) in an email body .

    Appreciate if you please respond quickly !!!

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,225
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Hi there,

    The approach I would probably take with this (and I'm not saying this is the only, right or best way) is to develop it in Excel first, then convert it to VBS afterwards. That way you get the benefit of all the debugging suite without guessing where your code went wrong. The secret is to convert everything to a late bound version for the VBS script.

    Do you have any programming experience at all, and have you got any of this working in Excel yet?
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    Hi Ken, thank you very much for getting back to me. yes i do have excel sheet connected with DBserver and its updating timely.I just need a VBS script that copying range of cells and email . Later i will schedule this .vbs file. thats it !!!



    Quote Originally Posted by Ken Puls View Post
    Hi there,

    The approach I would probably take with this (and I'm not saying this is the only, right or best way) is to develop it in Excel first, then convert it to VBS afterwards. That way you get the benefit of all the debugging suite without guessing where your code went wrong. The secret is to convert everything to a late bound version for the VBS script.

    Do you have any programming experience at all, and have you got any of this working in Excel yet?

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,225
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    So... is this workbook running and open all the time then? You want to connect to the open Excel instance, or do you need to have the macro open the workbook first, then copy the cells? Is the range of cells being copied always the same or does it change?
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  5. #5
    Quote Originally Posted by Ken Puls View Post
    So... is this workbook running and open all the time then? You want to connect to the open Excel instance, or do you need to have the macro open the workbook first, then copy the cells? Is the range of cells being copied always the same or does it change?
    my excel always opens in and it is connected with SQL server(query embedded) and retrieving my requested data time by time. I need somethign tht copies range of cell and email my team the body autmatically

  6. #6
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,225
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    So here's a question for you. If Excel is always open and running, is there any reason why you can't schedule this using VBA inside Excel, rather than using VBS? Coding from VBS to grab the open workbook is going to be a pain, while scheduling from inside VBA should be relatively easy...
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

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