Results 1 to 8 of 8

Correcting a Run-time error ‘445’ problem

Threaded View

  1. #1
    Registered User
    Join Date
    01-15-2011
    Location
    Clearfield, UT
    MS-Off Ver
    Excel 2016
    Posts
    58

    Correcting a Run-time error ‘445’ problem

    I'm trying to modify an Excel 2003 macro that will open a workbook in a folder, print it, close that workbook, open another one and keep printing and closing workbooks in the folder until they're all printed. I know I can no longer use "Set fs = Application.FileSearch" in Excel 2010, but I don't know or understand the alternatives. The macro I used before the change to 2010 is listed below. I would appreciate it if someone could show me how to replace the "Set fs = Application.FileSearch" with the new and accepted alternative. Thanks in advance! JPDutch

    Sub Print3()
    '
    ' MacroGRP2 Macro
    ' Macro recorded 01/06/2012 by jpdutch
    '
    ' This starts the print job
        Dim fs As FileSearch
        Dim i As Integer
        Dim wbk As Workbook
    
        Set fs = Application.FileSearch
    
        With fs
            .LookIn = ThisWorkbook.Path
            .Filename = "*.xls"
        For i = 200 To .Execute()
            Set wbk = Workbooks.Open(.FoundFiles(i))
    '   This will print the document
             ActiveWorkbook.PrintOut Copies:=1, Collate:=True
    '   Wait
            newHour = Hour(Now())
            newMinute = Minute(Now())
            newSecond = Second(Now()) + 7
            waitTime = TimeSerial(newHour, newMinute, newSecond)
            Application.Wait waitTime
        wbk.Close SaveChanges:=True
        Next i
    End With
    End Sub
    Last edited by JPDutch; 01-22-2013 at 03:17 PM. Reason: Solved

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