+ Reply to Thread
Results 1 to 11 of 11

Printing External files

  1. #1
    Registered User
    Join Date
    01-18-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    49

    Printing External files

    I've been trying to find a solution to this problem but I just cant find one.

    I have a series of excel workbooks, each corresponds to maintenance orders. Then I have a master list on an excel workbook with information regarding each maintenance order. These are done on a weekly, bi-weekly, monthly, quarterly, yearly basis. On the master list, the orders show a status that tells how urgent the order is, I also have a status that just tells if the order is due at the end of the week or not. I would like to be able to print out the orders that are due at the end of the week (which are workbooks) by pressing one button. Currently I do have a macro, that someone here was kind of enough to help me with, that prints out workbooks in a certain folder with the certain file format that the maint. order have but I havent figured out how to sort which files go into this folder.

    I realize thats probably confusing so please let me know if you have any questions and I will post up some dummy files to help explain. Also I have been searching like crazy but if there is a similar question answered, I apologize and please point me in that direction. i would really appreciate any help. Thank you in advance.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Printing External files

    Provide:

    1) a copy of the master workbook
    2) the path to the files in question
    3) clear instruction as to how the filenames translate between the master file and the path (if not abundantly clear from the master workbook data
    4) clear instruction on evaluating the due date range (from/to) for a typical week

    A macro can filter through the data set examining the dates using the range you've provided, the filenames you've provided, open and print those files.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-18-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Printing External files

    I appreciate the response! I've attached a copy of what the master list looks like. The PM is a reference to a maintenance order. The actual file names for each of those maint orders are exactly as the master list shows, so PM# 30011-11 has a file named 30011-11.xls. The path to where these PM files are located is:

    C:\Documents and Settings\User\My Documents\Maint. PM

    There is absolutely no link between the PM# on the master list and the actual file. That's really where I have the problem.

    The last completion date is taken from another file where a user inputs when it was completed, the next due date is generated based on a predetermined time line that I created, and I used conditional formatting for the status and weekly status. Please let me know if you have any other questions, I really appreciate the help!
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Printing External files

    Here you go, this should do it. The macro will keep count of the files to print, the files not found and will list the files it could not find at then, if any.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-04-2010 at 01:33 PM. Reason: edit popup section at end.

  5. #5
    Registered User
    Join Date
    01-18-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Printing External files

    Thanks a lot for the help JBeaucaire, I really appreciate you taking the time. I tried the code and when it reached the Application.ScreenUpdating = False line, it said Compile error: Invalid Outside procedure. I'm not sure what that means, please advise.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Printing External files

    Something you copied/pasted ended up in the wrong place. That line of code is INSIDE the sub, so you shouldn't be getting that error.

    Post up the workbook with the macro already installed, let me take a look.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Printing External files

    Did you get it worked out?

  8. #8
    Registered User
    Join Date
    01-18-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Printing External files

    I apologize for not getting back to you but I was out of the country for work. I checked and there was and the error was mine. I had no copied the entire code but now it runs but it only says A total of 0 workbook(s) have been printed. I've attached the actual file. I would really appreciate the help. THank you so much.
    Attached Files Attached Files

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Printing External files

    Fix this first...see if it helps:
    Please Login or Register  to view this content.
    You changed it, put it back to upper case (that's what UCase does, converts the string to upper case to eliminate any variations that might occur.

  10. #10
    Registered User
    Join Date
    01-18-2010
    Location
    California, US
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Printing External files

    I tried and got the same result.

    I was wondering, is this part supposed to be just a comment?
    Please Login or Register  to view this content.

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Printing External files

    No, not at all. That's your printout command. It's disabled to prevent printing during testing, just turn it back on to make it active.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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