Hi:
I have an excel sheet that when opened runs a macro that refreshes a Pivot table.
This is the macro code.
ActiveSheet.PivotTables("P
ivotTable2
").PivotCa
che.Refres
h
Application.ActivePrinter = "\\PC-sonia\HP LaserJet 4250 on Ne02:"
ActiveWindow.SelectedSheet
s.PrintOut
Copies:=1, ActivePrinter:= _
"\\PC-sonia\HP LaserJet 4250 on Ne02:", Collate:=True
Windows("Book2.xls").Activ
ate
ThisWorkbook.Saved = True
This was working on a an old server, I have to move to workbook to a different server, and i give me the following error. I have moved the files onto a new server and it needs to print to a different printer. I tried replacing the name of the printer directory with the following code:
Application.ActivePrinter = "\\PC-Magatzem\HP LaserJet 4200 PCL6 on Ne02:" and it gives me an 1004 error "Method 'Action printer' object _'Application'". I think it's a problem with the port reference. I also tried creating an IP port, but no luck either. What can I do to fix this? and/or How can I find out the port reference?
thanks,
Joseph
Start Free Trial