LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default #NAME? Error

I am using the following code in a COM based application:

excelApp.Cells.Item[2,13]:=EncodeDate(2003,12,8);
excelApp.Cells.Item[2,14]:=EncodeDate(2003,12,10);
excelApp.Cells.Item[2,15]:='=NetWorkDays(M2,N2)';

The first two lines simply insert these dates into cells M2 and N2.
The next line should return the Working days between these dates (in
cell O2).

The procedure executes without any error, but when I open the Excel
Workbook cell O2 contains #NAME?, althogh the formula bar shows the
correct formula. If I then select cell O2 and press ENTER I get the
correct value (3).

I have also tried the following with the same results:

excelApp.Cells.Item[2,15].Select;
excelApp.ActiveCell.Formula:='=NetWorkDays(M2,N2)' ;

Any suggestions would be appreciated.

Nirmal Singh


 
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
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 06:53 PM.

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

About Us

"It's about Microsoft Excel"