Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dbl
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
dbl
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
How do I calculate if a date is in a certain time frame? Pe66les Excel Worksheet Functions 19 August 27th 05 11:07 PM
search for latest date Sue Excel Worksheet Functions 2 August 2nd 05 11:09 PM
Recurring annual events using a specific date as a trigger date Bamboozled Excel Worksheet Functions 1 June 6th 05 01:44 PM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"