Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create a schedule from a list of dates ? | Charts and Charting in Excel | |||
NETWORKDAYS - Multiple Date Selection | Excel Discussion (Misc queries) | |||
How do I calculate if a date is in a certain time frame? | Excel Worksheet Functions | |||
search for latest date | Excel Worksheet Functions | |||
Recurring annual events using a specific date as a trigger date | Excel Worksheet Functions |