![]() |
Library missing
Hi all,
I have the following problem. I have a button executing VBA code (below) to print an array of worksheets. This code has been working flawlessly, and has not been changed in any way. However, after emailing the file to a user on another pc, the problem below pops up. Can anyone help? Hi- am having a technical problem with this one- it won't print out. When I hit the 'print invoice' button, a message pops up saying "compile error- can't find project or library", and then visual basic pops up. I've pasted in the script below. There should be an arrow pointing to the line " Private Sub btnPrintInv_Click() Private Sub btnPrintInv_Click() 'This procedure executes when the user clicks the Print Invoice button and print 'previews all the invoice areas from Inv Summ to result 10. frmWait.Show o frmWait.Repaint With Sheets(Array("Inv Summ", "Result 1", "Result 2", "Result 3", "Result 4", "Result 5", _ "Result 6", "Result 7", "Result 8", "Result 9", "Result 10")) SetPrintAreasInv frmWait.Hide ..PrintPreview End With Worksheets("Help").Activate Worksheets("Inv Summ").Activate Range("A1").Select end sub Sub SetPrintAreasInv() 'This procedure confirms that the print settings for each sheet are correct. Application.ScreenUpdating = False For Each Sheet In Sheets If Sheet.Name = "Help" Or Sheet.Name = "Billing Rates" Or _ Sheet.Name = "Analysis" Or Sheet.Name = "Expense Schedule" Then 'Do nothing Else With Sheet.PageSetup If .TopMargin < Application.InchesToPoints(0.5) Then .TopMargin = Application.InchesToPoints(0.5) End If .CenterHeader = "" .BlackAndWhite = True .PrintArea = "$A$1:$I$70" If .CenterHeader < "" Then .CenterHeader = "" If .LeftFooter < "&8Printed: &T on &D" Then .LeftFooter = "&8Printed: &T on &D" If .RightFooter < "&8&F" Then .RightFooter = "&8&F" If .LeftMargin < Application.CentimetersToPoints(2.1) Then .LeftMargin = Application.CentimetersToPoints(2.1) End If .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With End If Next Application.ScreenUpdating = True End Sub |
Library missing
After that error, have the user go into the VBE and look in
tools=References and see if there is a reference there marked as MISSING. If so, you need to resolve this missing reference. -- Regards, Tom Ogilvy "lk" wrote in message ... Hi all, I have the following problem. I have a button executing VBA code (below) to print an array of worksheets. This code has been working flawlessly, and has not been changed in any way. However, after emailing the file to a user on another pc, the problem below pops up. Can anyone help? Hi- am having a technical problem with this one- it won't print out. When I hit the 'print invoice' button, a message pops up saying "compile error- can't find project or library", and then visual basic pops up. I've pasted in the script below. There should be an arrow pointing to the line " Private Sub btnPrintInv_Click() Private Sub btnPrintInv_Click() 'This procedure executes when the user clicks the Print Invoice button and print 'previews all the invoice areas from Inv Summ to result 10. frmWait.Show o frmWait.Repaint With Sheets(Array("Inv Summ", "Result 1", "Result 2", "Result 3", "Result 4", "Result 5", _ "Result 6", "Result 7", "Result 8", "Result 9", "Result 10")) SetPrintAreasInv frmWait.Hide .PrintPreview End With Worksheets("Help").Activate Worksheets("Inv Summ").Activate Range("A1").Select end sub Sub SetPrintAreasInv() 'This procedure confirms that the print settings for each sheet are correct. Application.ScreenUpdating = False For Each Sheet In Sheets If Sheet.Name = "Help" Or Sheet.Name = "Billing Rates" Or _ Sheet.Name = "Analysis" Or Sheet.Name = "Expense Schedule" Then 'Do nothing Else With Sheet.PageSetup If .TopMargin < Application.InchesToPoints(0.5) Then .TopMargin = Application.InchesToPoints(0.5) End If .CenterHeader = "" .BlackAndWhite = True .PrintArea = "$A$1:$I$70" If .CenterHeader < "" Then .CenterHeader = "" If .LeftFooter < "&8Printed: &T on &D" Then .LeftFooter = "&8Printed: &T on &D" If .RightFooter < "&8&F" Then .RightFooter = "&8&F" If .LeftMargin < Application.CentimetersToPoints(2.1) Then .LeftMargin = Application.CentimetersToPoints(2.1) End If .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With End If Next Application.ScreenUpdating = True End Sub |
Library missing
Thanks Tom!!
Appreciate the help. "Tom Ogilvy" wrote in message ... After that error, have the user go into the VBE and look in tools=References and see if there is a reference there marked as MISSING. If so, you need to resolve this missing reference. -- Regards, Tom Ogilvy "lk" wrote in message ... Hi all, I have the following problem. I have a button executing VBA code (below) to print an array of worksheets. This code has been working flawlessly, and has not been changed in any way. However, after emailing the file to a user on another pc, the problem below pops up. Can anyone help? Hi- am having a technical problem with this one- it won't print out. When I hit the 'print invoice' button, a message pops up saying "compile error- can't find project or library", and then visual basic pops up. I've pasted in the script below. There should be an arrow pointing to the line " Private Sub btnPrintInv_Click() Private Sub btnPrintInv_Click() 'This procedure executes when the user clicks the Print Invoice button and print 'previews all the invoice areas from Inv Summ to result 10. frmWait.Show o frmWait.Repaint With Sheets(Array("Inv Summ", "Result 1", "Result 2", "Result 3", "Result 4", "Result 5", _ "Result 6", "Result 7", "Result 8", "Result 9", "Result 10")) SetPrintAreasInv frmWait.Hide .PrintPreview End With Worksheets("Help").Activate Worksheets("Inv Summ").Activate Range("A1").Select end sub Sub SetPrintAreasInv() 'This procedure confirms that the print settings for each sheet are correct. Application.ScreenUpdating = False For Each Sheet In Sheets If Sheet.Name = "Help" Or Sheet.Name = "Billing Rates" Or _ Sheet.Name = "Analysis" Or Sheet.Name = "Expense Schedule" Then 'Do nothing Else With Sheet.PageSetup If .TopMargin < Application.InchesToPoints(0.5) Then .TopMargin = Application.InchesToPoints(0.5) End If .CenterHeader = "" .BlackAndWhite = True .PrintArea = "$A$1:$I$70" If .CenterHeader < "" Then .CenterHeader = "" If .LeftFooter < "&8Printed: &T on &D" Then .LeftFooter = "&8Printed: &T on &D" If .RightFooter < "&8&F" Then .RightFooter = "&8&F" If .LeftMargin < Application.CentimetersToPoints(2.1) Then .LeftMargin = Application.CentimetersToPoints(2.1) End If .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With End If Next Application.ScreenUpdating = True End Sub |
All times are GMT +1. The time now is 12:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com