Complile Error with Date
Hi I get the following error message "Can't Find Project or Library" when I
run the following code: Application.ScreenUpdating = False ActiveWindow.WindowState = xlMinimized Workbooks.Open(Filename:="T:\Car Hire\Car Hire Invoice.xls").RunAutoMacros _ Which:=xlAutoOpen ActiveWindow.WindowState = xlMinimized Workbooks.Open Filename:="T:\Car Hire\InvoiceNosCarHire.xls" Sheets("Sheet1").Select ActiveCell.Offset(1, 0).Range("A1").Select Selection.Copy ActiveWindow.WindowState = xlMinimized Windows("Car Hire Invoice.xls").Activate ActiveWindow.WindowState = xlMaximized Sheets("Invoice").Select Range("K6").Select ActiveSheet.Paste Range("K7").Select ActiveCell.FormulaR1C1 = "=Today()" Range("K7") = Date This is only part of the code. It always stops on "Range("K7") = Date" on the word Date. If you delete this line of code it runs fine to this point. This run fine on my old computer put since I have upgrade to a new computer using the same software Win XP Pro and Office 2003 Pro (both upgrades from Win 2000 and Office 97 Pro) the code will not run past the word "Date" Any help would be very much appreciated. Bob |
Firstly, check if there are any missing references. In the VBIDE go to
ToolsReferences. Uncheck any MISSING items that are checked. -- HTH Bob Phillips "dbl" wrote in message ... Hi I get the following error message "Can't Find Project or Library" when I run the following code: Application.ScreenUpdating = False ActiveWindow.WindowState = xlMinimized Workbooks.Open(Filename:="T:\Car Hire\Car Hire Invoice.xls").RunAutoMacros _ Which:=xlAutoOpen ActiveWindow.WindowState = xlMinimized Workbooks.Open Filename:="T:\Car Hire\InvoiceNosCarHire.xls" Sheets("Sheet1").Select ActiveCell.Offset(1, 0).Range("A1").Select Selection.Copy ActiveWindow.WindowState = xlMinimized Windows("Car Hire Invoice.xls").Activate ActiveWindow.WindowState = xlMaximized Sheets("Invoice").Select Range("K6").Select ActiveSheet.Paste Range("K7").Select ActiveCell.FormulaR1C1 = "=Today()" Range("K7") = Date This is only part of the code. It always stops on "Range("K7") = Date" on the word Date. If you delete this line of code it runs fine to this point. This run fine on my old computer put since I have upgrade to a new computer using the same software Win XP Pro and Office 2003 Pro (both upgrades from Win 2000 and Office 97 Pro) the code will not run past the word "Date" Any help would be very much appreciated. Bob |
Bob thanks very much, that has sorted the problem.
Regards Bob "Bob Phillips" wrote in message ... Firstly, check if there are any missing references. In the VBIDE go to ToolsReferences. Uncheck any MISSING items that are checked. -- HTH Bob Phillips "dbl" wrote in message ... Hi I get the following error message "Can't Find Project or Library" when I run the following code: Application.ScreenUpdating = False ActiveWindow.WindowState = xlMinimized Workbooks.Open(Filename:="T:\Car Hire\Car Hire Invoice.xls").RunAutoMacros _ Which:=xlAutoOpen ActiveWindow.WindowState = xlMinimized Workbooks.Open Filename:="T:\Car Hire\InvoiceNosCarHire.xls" Sheets("Sheet1").Select ActiveCell.Offset(1, 0).Range("A1").Select Selection.Copy ActiveWindow.WindowState = xlMinimized Windows("Car Hire Invoice.xls").Activate ActiveWindow.WindowState = xlMaximized Sheets("Invoice").Select Range("K6").Select ActiveSheet.Paste Range("K7").Select ActiveCell.FormulaR1C1 = "=Today()" Range("K7") = Date This is only part of the code. It always stops on "Range("K7") = Date" on the word Date. If you delete this line of code it runs fine to this point. This run fine on my old computer put since I have upgrade to a new computer using the same software Win XP Pro and Office 2003 Pro (both upgrades from Win 2000 and Office 97 Pro) the code will not run past the word "Date" Any help would be very much appreciated. Bob |
All times are GMT +1. The time now is 07:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com