from inside excel off of a button on the form
Ken, I have the basic macro for you. Currently, it will take your input from the input box and search the path for that string and print those that match.Sub Batch_Print() Dim Input_Dir, Print_File As String Input_Dir = InputBox _ ("Input directory path containing the files to print") ' Defines Print_File equal to the first Microsoft Excel file found ' in the directory specified in the InputBox above. Print_File = Dir("D:\new sws folder\maintenance\poreq\*"&Input_Dir & "*.xl*") ' If you are using Microsoft Excel for the Macintosh, you need ' to change Print_File = Dir(Input_Dir & "' .xl*") to ' ' If you are using Microsoft Excel 5.0, use this line ' Print_File = Dir(Input_Dir & ":", MacID("XLS5")) ' ' If you are using Microsoft Excel 98, use this line ' Print_File = Dir(Input_Dir & ":", MacID("XLS8")) ' ' and change Workbooks.Open Filename:=Input_Dir & "\" & Print_File ' to: ' ' Workbooks.Open Filename:=Input_Dir & ":" & Print_File ' Loops through the directory specified in the above InputBox ' and opens each workbook in the directory, prints all sheets ' in the workbook and closes the workbook. Continues until are ' all files are printed. Do While Len(Print_File) > 0 Workbooks.Open Filename:=Print_File ActiveWorkbook.PrintOut Copies:=1 ActiveWorkbook.Close Print_File = Dir() Loop End Sub
Its giving me a error message it says
Run-time error '1004':
'PO-kenm-3170-5-5-13 could not be found check the spelling of the file name and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved or deleted
I verified the file name and location and even opened it manualy
I am using windows 7, office 2010
Thanks a lot that seems to be doing it
My question page says im still waiting for a response from the pro did I not close this out correctly you did a awesome job and would like to make sure I did what I needed to on my end for you
You did, Ken. Thank you very much! And thank you for the compliment!
It was a pleasure working with you!