Run-Time Error 1004 Printer not Detected

Boutchoo

New Member
Joined
May 2, 2014
Messages
1
Hi, I will make this short and sweet.
Here, at my place, I have around 10 printers. Not connected at the same time.
I have my Main Printer (Brother MFC-255CW) to print from Excel with a macro.
An hour ago, I "Removed" from "Devices and printers" all of my printers, then replugged them one by one so Windows 7 install the drivers again.

The thing is that my Excel Macro bind with a "PRINT" Button is no longer working.
I never touched my MFC-255CW, and it stayed the Default Printer.

When I click the PRINT button, in excel, I get many things:
Cannot find the Printer MFC-255CW
Canno access the file '05-02-2014.xls' (wich changes each time I do the macro FINALSAVE at the end of the day, that creates a new excel named "TODAY" for the next day.).

I can't work without this file working proprely!

I have clicked "Debbug" and it highlight this:

Code:
ActiveWorkbook.SaveAs Filename:=newFile
And this:
Code:
Selection.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False

this is my whole module11 Macro:

Code:
Sub Macro1()

' Macro recorded 06/01/2011 by IBM_USER
'
' Keyboard Shortcut: Ctrl+s
'
 ' NEXT INVOICE
 
    'Sheets("Invoice").Select
    'Range("I5").Select
    'Range("I5") = Range("I5") + 1
    
    Range("G9") = Now()


' new line in daily

    Sheets("Daily").Select
    i = Range("A4")
    Range("A4") = Range("A4") + 1
    
' First Row  Copy

    Sheets("Invoice").Select
    Range("A16").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("B" & i).Select
    ActiveSheet.Paste
    
    Sheets("Invoice").Select
    Range("j16").Select
    Range("Z16") = Range("J16").Value
    Range("Z16").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("D" & i).Select
    ActiveSheet.Paste
    
  
' Second Row  Copy

    Sheets("Invoice").Select
    Range("A17").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("E" & i).Select
    ActiveSheet.Paste
    
    Sheets("Invoice").Select
    Range("j17").Select
    Range("Z16") = Range("J17").Value
    Range("Z16").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("G" & i).Select
    ActiveSheet.Paste
    
 ' THIRD Row  Copy

    Sheets("Invoice").Select
    Range("A18").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("H" & i).Select
    ActiveSheet.Paste
    
    Sheets("Invoice").Select
    Range("j18").Select
    Range("Z16") = Range("J18").Value
    Range("Z16").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("J" & i).Select
    ActiveSheet.Paste
    
' FORTH  Row  Copy

    Sheets("Invoice").Select
    Range("A19").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("K" & i).Select
    ActiveSheet.Paste
    
    Sheets("Invoice").Select
    Range("j19").Select
    Range("Z16") = Range("J19").Value
    Range("Z16").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("M" & i).Select
    ActiveSheet.Paste
   
   
' 5TH  Row  Copy

    Sheets("Invoice").Select
    Range("A20").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("N" & i).Select
    ActiveSheet.Paste
    
    Sheets("Invoice").Select
    Range("j20").Select
    Range("Z16") = Range("J20").Value
    Range("Z16").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("P" & i).Select
    ActiveSheet.Paste
    
    
' 6TH   Row  Copy

    Sheets("Invoice").Select
    Range("A21").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("Q" & i).Select
    ActiveSheet.Paste
    
    Sheets("Invoice").Select
    Range("j21").Select
    Range("Z16") = Range("J21").Value
    Range("Z16").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("S" & i).Select
    ActiveSheet.Paste
    
    Sheets("Invoice").Select
    
    
    
 'copy invoice#
   '
    'Sheets("Invoice").Select
    'Range("I5").Select
    'Range("Z18") = Range("I5").Value
    'Range("Z18").Select
    'Selection.Copy
    'Sheets("Daily").Select
    'Range("T" & i).Select
    'ActiveSheet.Paste
       
    
    Sheets("Invoice").Select
    Range("I5").Select
    Range("Z18") = Range("I5").Value
    Range("Z18").Select
    Selection.Copy
    Sheets("Daily").Select
    Range("T" & i).Select
    ActiveSheet.Paste
    
    
 ' TIME STAMP ON DAILY
 
    Sheets("Invoice").Select
    Range("G9").Select
    Range("Z17") = Range("G9").Value
    Range("Z17").Select
    
    Selection.Copy
    Sheets("Daily").Select
    Range("Z" & i).Select
    ActiveSheet.Paste
    
    
    
  ' Sheets("Invoice").Select
  ' ActiveWorkbook.SAVE
   
   

 ' NEXT INVOICE
 
    Sheets("Invoice").Select
    Range("I5").Select
    Range("I5") = Range("I5") + 1
    
    Range("G9") = Now()
    
    
    
    
' ERASE

   ' First raw
       
    Range("A16").Select
    ActiveCell.FormulaR1C1 = " "
    Range("C16").Select
    ActiveCell.FormulaR1C1 = " "
    Range("D16").Select
    ActiveCell.FormulaR1C1 = " "
    Range("G16").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("H16").Select
    ActiveCell.FormulaR1C1 = "0"
    
    ' 2nd raw
       
    Range("A17").Select
    ActiveCell.FormulaR1C1 = " "
    Range("C17").Select
    ActiveCell.FormulaR1C1 = " "
    Range("D17").Select
    ActiveCell.FormulaR1C1 = " "
    Range("G17").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("H17").Select
    ActiveCell.FormulaR1C1 = "0"

    ' 3nd raw
       
    Range("A18").Select
    ActiveCell.FormulaR1C1 = " "
    Range("C18").Select
    ActiveCell.FormulaR1C1 = " "
    Range("D18").Select
    ActiveCell.FormulaR1C1 = " "
    Range("G18").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("H18").Select
    ActiveCell.FormulaR1C1 = "0"
    
    ' 4nd raw
       
    Range("A19").Select
    ActiveCell.FormulaR1C1 = " "
    Range("C19").Select
    ActiveCell.FormulaR1C1 = " "
    Range("D19").Select
    ActiveCell.FormulaR1C1 = " "
    Range("G19").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("H19").Select
    ActiveCell.FormulaR1C1 = "0"
    
    ' 5nd raw
       
    Range("A20").Select
    ActiveCell.FormulaR1C1 = " "
    Range("C20").Select
    ActiveCell.FormulaR1C1 = " "
    Range("D20").Select
    ActiveCell.FormulaR1C1 = " "
    Range("G20").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("H20").Select
    ActiveCell.FormulaR1C1 = "0"
    
    ' 6nd raw
       
    Range("A21").Select
    ActiveCell.FormulaR1C1 = " "
    Range("C21").Select
    ActiveCell.FormulaR1C1 = " "
    Range("D21").Select
    ActiveCell.FormulaR1C1 = " "
    Range("G21").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("H21").Select
    ActiveCell.FormulaR1C1 = "0"
    
    
    
    
    
'    ChDir "C:\Documents and Settings"
'   ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\TODAY.xls", _
'  FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
' ReadOnlyRecommended:=False, CreateBackup:=False
        
        
        
        Dim newFile As String, fName As String
'  Don't use "/" in date, invalid syntax
        fName = Range("M1").Value
'Change the date format to whatever you'd like, but make sure it's in quotes
        newFile = fName & " " & Format$(Date, "mm-dd-yyyy")
' Change directory to suit your PC, including USER NAME
        ChDir "C:\Documents and Settings"
        
        
        
        
        
        
        
        
        
        
        ActiveWorkbook.SaveAs Filename:=newFile
        
        
        '
' Macro4 Macro
' Macro recorded 2012-04-13 by IBM_USER
'

'

    Sheets("Daily").Select
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 5
    ActiveWindow.ScrollColumn = 6
    ActiveWindow.ScrollColumn = 7
    ActiveWindow.ScrollColumn = 8
    ActiveWindow.ScrollColumn = 9
    ActiveWindow.ScrollColumn = 10
    ActiveWindow.ScrollColumn = 11
    ActiveWindow.ScrollColumn = 12
    ActiveWindow.ScrollColumn = 13
    Range("Z3:Z23").Select
    Selection.Font.ColorIndex = 0
    Range("B3:S12").Select
    Range("S12").Activate
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    Selection.Font.ColorIndex = 0
    ActiveWindow.ScrollColumn = 11
    ActiveWindow.ScrollColumn = 10
    ActiveWindow.ScrollColumn = 9
    ActiveWindow.ScrollColumn = 8
    ActiveWindow.ScrollColumn = 7
    ActiveWindow.ScrollColumn = 6
    ActiveWindow.ScrollColumn = 5
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 1
    Range("B12:C12").Select
      
    Range("T3:T23").Select
    Selection.Font.ColorIndex = 0
    Range("T3").Select
    Sheets("Invoice").Select
    Range("I5").Select
       
        
  
    
   
End Sub
I was wondering what could cause this?
I have been very careful when playing in Devices and Printers.
I am 100% sure to not have touched the Main Printer.
Maybe if I reinstall the drivers, I already unplugged the USB wire and reboot the Printer.

Thank you in advance!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top