Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
srikantha
 
Posts: n/a
Default Problem writing Excel formulas via ODBC


Hi All

I have a C++ program writing records to an Excel spreadsheet using the
ODBC classes and ExecuteSQL. The text and number values are inserted
ok. However, I am also trying to write a formula (eg.
=HYPERLINK("http://www.sasken.com", "Click here for the abc site") )
into the sheet.

The problem: the formula is displayed as a formula - it does not
calculate and show the result of the formula. If I edit the formula
(changing nothing but simply pressing return to re-enter the original
value) then the formula is 'activated' and the result is calculated. In
the example above, the hyperlink is displayed as a link.

The same problem exists for any formula (even something as simple as
=2+2).

Does anyone know why the formula is not calculated ? Pressing F9,
Shift-F9, Crtl-Alt-F9, or calculating the worksheet with VBA doesn't
have any effect.

I can't believe that formulas have to be manually entered or edited
before they become 'active'.

If I am missing something please let me know. Thanks in advance

--
With Warm Regards,
M.Srikantha


--
srikanthaPosted from http://www.pcreview.co.uk/ newsgroup access

  #2   Report Post  
JPW
 
Posts: n/a
Default

Your program needs to check if the value is a formula (i.e. look for the =
sign) and if it is, set the cell's .Formula property, NOT the cell's .Value
property.

"srikantha" <srikantha.1qytvz@ wrote in message
...

Hi All

I have a C++ program writing records to an Excel spreadsheet using the
ODBC classes and ExecuteSQL. The text and number values are inserted
ok. However, I am also trying to write a formula (eg.
=HYPERLINK("http://www.sasken.com", "Click here for the abc site") )
into the sheet.

The problem: the formula is displayed as a formula - it does not
calculate and show the result of the formula. If I edit the formula
(changing nothing but simply pressing return to re-enter the original
value) then the formula is 'activated' and the result is calculated. In
the example above, the hyperlink is displayed as a link.

The same problem exists for any formula (even something as simple as
=2+2).

Does anyone know why the formula is not calculated ? Pressing F9,
Shift-F9, Crtl-Alt-F9, or calculating the worksheet with VBA doesn't
have any effect.

I can't believe that formulas have to be manually entered or edited
before they become 'active'.

If I am missing something please let me know. Thanks in advance

--
With Warm Regards,
M.Srikantha


--
srikanthaPosted from http://www.pcreview.co.uk/ newsgroup access



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
Problem writing Excel formulas via ODBC srikantha Excel Discussion (Misc queries) 0 June 21st 05 08:24 AM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
EXCEL FORMAT PROBLEM WHEN SENDING EXCEL SHEET AS MESSAGE BODY IN . P.S.Sodha Excel Discussion (Misc queries) 0 April 2nd 05 01:53 PM
EXCEL 2003 PROBLEM Amandle Excel Worksheet Functions 4 April 1st 05 02:25 PM
Problem Opening An Excel file. - by yk ilikecy Excel Discussion (Misc queries) 0 February 4th 05 08:19 AM


All times are GMT +1. The time now is 07:57 AM.

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"