Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.dotnet.languages.vb
pp pp is offline
external usenet poster
 
Posts: 3
Default Problems with the excel find function in vb.net

I have copied this code from Excel VBA, to use in a VB.net application:

Dim r as Excel.Range

r=Cells.Find(What:="02/01/2001 22:00:00", After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

But in VB.net, the editor doesn’t recognise de following constants:
ActiveCell, xlFormulas, xlPart, xlByRows.

Do you have any ideas?

Thanks,
Paulo Praça
  #2   Report Post  
Posted to microsoft.public.dotnet.languages.vb,microsoft.public.excel.programming,microsoft.public.excel
external usenet poster
 
Posts: 16
Default Problems with the excel find function in vb.net

Imports Excel = Microsoft.Office.Interop.Excel

Sub Main()
Dim r As Excel.Range

r = Cells.Find( _
What:="02/01/2001 22:00:00", _
, _ <-- Can leave it blank here
LookIn:=Excel.XlFindLookIn.xlFormulas, _
LookAt:=Excel.XlLookAt.xlPart, _
SearchOrder:=Excel.XlSearchOrder.xlByRows, _
SearchDirection:=Excel.XlSearchDirection.xlNext, _
MatchCase:=False, _
SearchFormat:=False)

.....

More info --
"http://msdn.microsoft.com/office/understanding/vsto/default.aspx?pull=/library/en-us/odc_vsto2003_ta/html/ExcelObj.asp"

HTH,
arunkhemlai


I have copied this code from Excel VBA, to use in a VB.net application:

Dim r as Excel.Range

r=Cells.Find(What:="02/01/2001 22:00:00", After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

But in VB.net, the editor doesnt recognise de following constants:
ActiveCell, xlFormulas, xlPart, xlByRows.

Do you have any ideas?

Thanks,
Paulo Praça

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
problems with Excel 2007 'system cannot find the file specified' [email protected] Setting up and Configuration of Excel 1 October 4th 08 08:58 AM
Problems with find/replace function BobS9895 Excel Worksheet Functions 1 September 8th 06 09:42 PM
Excel function problems mustanggt89 Excel Worksheet Functions 1 June 2nd 05 03:25 PM
Problems with Find in VBA/Excel Roy Kirkland Excel Worksheet Functions 0 November 22nd 04 02:58 AM
Problems with Find and Date Fields in Excel macro Nick Marshall Excel Programming 1 October 15th 03 05:01 PM


All times are GMT +1. The time now is 10:09 PM.

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"