Baldeagle
07-23-2014, 02:34 AM
Good morning,
As a company we are in the process of migrating Office 2003 to Office 2010. We have a number of Macros written many years ago, by a person that has since left the company, only to fine the Macro starts to run then fails at the first ActiveWorkbook.Save stage.
The Macro is some 1734 lines long, and the first Save is at Line 48, therefore I am only including the first section. I can provide the full routine if needed.
Can anyone assist me in the reason for the failure.
Sub PRINT_DEBITNOTE_DOCS1()
'
' PRINT_DEBITNOTE_DOCS3 Macro
' Macro recorded 19/05/2000 by jstevenson
'
' Keyboard Shortcut: Ctrl+Shift+W
Application.DisplayAlerts = False
Workbooks.Open Filename:="\\Neptune\Doehle\Accounts\Crew\crewaccs\NEW 2012 LSUMS-MID\ATLANTSKA PLOVIDBA LUMPSUMS\LSUM-AP001.xls", UpdateLinks:=3
Calculate
Application.Goto Reference:="DEBITNOTEUSD"
ActiveSheet.PageSetup.PrintArea = "DEBITNOTEUSD"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "DEBITNOTEUSD"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(0.69)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.Save
ActiveWorkbook.Close
Thanks in anticipation of any help you can give.
As a company we are in the process of migrating Office 2003 to Office 2010. We have a number of Macros written many years ago, by a person that has since left the company, only to fine the Macro starts to run then fails at the first ActiveWorkbook.Save stage.
The Macro is some 1734 lines long, and the first Save is at Line 48, therefore I am only including the first section. I can provide the full routine if needed.
Can anyone assist me in the reason for the failure.
Sub PRINT_DEBITNOTE_DOCS1()
'
' PRINT_DEBITNOTE_DOCS3 Macro
' Macro recorded 19/05/2000 by jstevenson
'
' Keyboard Shortcut: Ctrl+Shift+W
Application.DisplayAlerts = False
Workbooks.Open Filename:="\\Neptune\Doehle\Accounts\Crew\crewaccs\NEW 2012 LSUMS-MID\ATLANTSKA PLOVIDBA LUMPSUMS\LSUM-AP001.xls", UpdateLinks:=3
Calculate
Application.Goto Reference:="DEBITNOTEUSD"
ActiveSheet.PageSetup.PrintArea = "DEBITNOTEUSD"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "DEBITNOTEUSD"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(0.69)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.Save
ActiveWorkbook.Close
Thanks in anticipation of any help you can give.