+ Reply to Thread
Results 1 to 8 of 8

Help to combine two Modules from seperate workbooks to one workbook preform task

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    Lake Elsinore
    MS-Off Ver
    Excel 2010
    Posts
    46

    Help to combine two Modules from seperate workbooks to one workbook preform task

    Hello all,

    With the help of many, I've been able to have code in two seperate workbooks that I would like to merge into one Module so that both commands can be done together.

    the 1st code allows the user to click a button and prepare the Excel page as PDF
    the 2nd code allows the user to click a button and prepare the Excel page to be saved as xls file (the document is actually xlsm- but I don't want the macros to be active when we send it out) then places the file in an email so the user just has to type in an email address and hit send.

    I would like to code to be combined so the user can click a button then the excel file will save to the local C drive (it currently does that) then take that saved document and create a PDF, then take the PDF and attach it to an OUTLOOK email.

    I realize that this is a huge task and I've tried working with the code to see if it can be done, but I'm just not that strong in VB code.

    I would appeciate any help you can offer!

    CODE 1
    Please Login or Register  to view this content.

    CODE 2

    Please Login or Register  to view this content.
    Again, thank you for any help you can offer!
    Last edited by tcrjmom; 09-19-2014 at 10:59 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,618

    Re: Help to combine two Modules from seperate workbooks to one workbook preform task

    You want to email the workbook as a PDF attachment; is that what you're asking?

    Create and Mail PDF files with Excel 2007/2013
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    Lake Elsinore
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Help to combine two Modules from seperate workbooks to one workbook preform task

    Yes, kinda - I need the PDF to be saved to the local drive with the naming path listed in the code then take that PDF and put it in an email.

  4. #4
    Registered User
    Join Date
    10-11-2012
    Location
    Lake Elsinore
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Help to combine two Modules from seperate workbooks to one workbook preform task

    Hello AlphaFrog,

    THANK YOU VERY MUCH for your link, but I have to say, I have SO little experience with VB Code that I have no idea what you link is telling me. I've tried to find and paste code that I thought would work, and for the most part it does work. The current part of the code that I have working is - once the Submit Order button is Clicked and the Order Acknowledge button is clicked the PDF is saved and placed in the directory that I've instructed in the the code. Below are the problems that I'm still having and hoping someone can help:

    1.) A copy of the Order Sheet is created and appears on the screen; however, I do not want that to appear - I know the issue is the Sheets("Order Form").Copy, but when I get rid of the code the - none of the other parts of it works.
    2.) A PDF copy appears; however, the attaching of the PDF to outlooks does not work.
    3.) After the UserForm1 is clicked, I want it to disapear but it does not, you have to X out of it.

    The code I found, looks like it should work; however, I think the probem has to do with the Title and the little section in the code, I have no idea on how to tell it to use the PDF that I just created.

    I realize I may be asking alot here, so PLEASE accept my request with knowledge that I COMPLETELY APPRECIATE any help you can offer. Below is the code that I'm trying to use:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,618

    Re: Help to combine two Modules from seperate workbooks to one workbook preform task

    Can you attach your workbook?

  6. #6
    Registered User
    Join Date
    10-11-2012
    Location
    Lake Elsinore
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Help to combine two Modules from seperate workbooks to one workbook preform task

    Hello AlphaFrog,

    I'm sorry, I can't attach my workbook because it contains many pricebooks links and private information. GOOD news is - I've been able to figure out the code to fix my problems #1 and #3. Bad news is, I still can't figure out how to send the "Newly Created" PDF into an outlook email.

    I'm sorry that I can't provide you more infomation to help me, I guess I will have to keep searching.

    THANK YOU AGAIN, for ALL of your Assistance. To all of you out here on this website who are offering your knowledge, Thank you - you are all pretty AMAZING!

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,618

    Re: Help to combine two Modules from seperate workbooks to one workbook preform task

    Glad you have it mostly working. For future reference, you wouldn't attach your actual file with sensitive info. Make a dummy workbook that illustrates the problem(s).

  8. #8
    Registered User
    Join Date
    10-11-2012
    Location
    Lake Elsinore
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Help to combine two Modules from seperate workbooks to one workbook preform task

    THANK YOU - THANK YOU - THANK YOU! AlphaFrog, I went back to the file that you sent me and tried to get understanding. I was finally able to work through the files and got - everything works PERFECT! Thank you so much for your assistance, it's GREATLY appreciated!

+ 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] combine multi workbooks into one master workbook but I want to combine only sheet 3
    By Goodstart14 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-31-2013, 12:22 AM
  2. [SOLVED] Save workbook as seperate workbooks
    By Floorplan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-06-2013, 10:29 AM
  3. Creating Seperate workbooks from origional Workbook
    By mike02 in forum Excel General
    Replies: 1
    Last Post: 07-27-2012, 11:01 AM
  4. Real time plus preform at task time
    By stonefox in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-02-2011, 05:42 AM
  5. [SOLVED] Merging seperate workbooks into one workbook
    By Raoul Duke in forum Excel General
    Replies: 2
    Last Post: 06-22-2005, 02:05 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