LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default VB.NET and Excel Range data

Are you explicitly using the range's Value (or equivalent) property
i.e. something like

CDbl(Range("A1").Value)

rather than the sloppy

CDbl(Range("A1"))

This is a heads up for everyone out there who implicitly use the Range
object's default method. Always *explicitly* use the Value method,
otherwise it may trip you up one day!

--

"Pete" wrote in message ...
I have a program written in VB6 that opens an Excel App;ication,

selects a worksheet and reads the data from 6 Cols x 15 Rows. This
data is placed into an array formated to type double and then VB6
performs some math calculations. No problem. I tried to convert this
small program to VB.NET and the best I can get is an error message to
the effect that the type Range cannot be converted to a type double. I
have upgraded my Office XP with the necessary Interop according to
Microsoft and have added the necessary references to my main program.
I did have all of my Excel calling and reading routines in a module
but now I'm trying to get away from a module situation. My 'not
working code' can be provided if someone is willing to look at it.

Thanks for anyones help.

Pete

 
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 name a range of data in excel scooter Excel Worksheet Functions 1 May 29th 08 09:28 PM
Excel 2003 - Charts - "Data Range" and Date/Time data on X-Axis erik Charts and Charting in Excel 1 August 20th 07 02:50 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
how can i use same range of data for different formulas in excel? kysazas Excel Discussion (Misc queries) 3 August 8th 06 02:04 PM
Range of data in Excel Narayanaswamy Excel Worksheet Functions 1 July 31st 06 05:05 PM


All times are GMT +1. The time now is 02:55 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"