+ Reply to Thread
Results 1 to 6 of 6

VBA code to save files

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    juba
    MS-Off Ver
    Office 365
    Posts
    17

    VBA code to save files

    I have created a code to create report from my existing data. i have to create two reports. all working fine.. But only one thing i am not able to do.. Please help me on executing the code together to get two separate report saved separately without changing any thing in the original fie. I have attached both codes and the sample excel file. Please help me with the code.
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VBA code to save files

    First, make certain the SUBs in module1.pdf are differently named from those in module2.pdf.

    Example : If Module1 has a sub named CheckTitles and Module2 has the same named sub ... simply add the number "2" to the end of the sub name in Module2.

    Module1 : Sub CheckTitles ()
    Module2 : Sub CheckTitles2 ()


    Paste all of your code from Module1.pdf into a Routine Module in your workbook.

    Paste all of your code from Module2.pdf into a separate Routine Module in your workbook.

    At the very bottom of you pasted code in Routine Module1, place a 'call' to the first sub located in Routine Module 2.


    Here is the very last of the code from Module1.pdf :

    Please Login or Register  to view this content.
    The first sub located in Routine Module2 is named " DOWNLOAD_STATUS "

    So at the very bottom of the last sub in Routine Module1 it would look like this :


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-17-2012
    Location
    juba
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to save files

    Yes, I did but again the original file closed after the first report get saved.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VBA code to save files

    I don't see anything in your code that tells either module to close the workbook.

    ????

  5. #5
    Registered User
    Join Date
    07-17-2012
    Location
    juba
    MS-Off Ver
    Office 365
    Posts
    17

    Re: VBA code to save files

    thats what i was also wondering why it is closing

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VBA code to save files

    Corrupted ?

+ 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. VBA code to save files in MAC Excel without Save dialog Box
    By Usha Srivalli in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2021, 08:43 AM
  2. Code to save INI files
    By ronalmog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2013, 12:53 AM
  3. Code to save INI files
    By ronalmog in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2013, 05:31 PM
  4. Replies: 1
    Last Post: 04-19-2012, 07:59 PM
  5. [SOLVED] Macro or Code to save email as RTF files
    By jesika in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2009, 04:53 AM
  6. VBA code to split sheets and save as seperate CSV files
    By mccrimmon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2008, 01:59 PM
  7. VBA Code to extract and save sections of worksheet to seperate files
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2007, 10:57 AM

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