473,569 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Run time error in find method using vba

7 New Member
I am trying to find the data in excel using word vba. Problem is it shows an run time error in find line.

Error number = 13
Error = Type mismatch

dim rcell as range
Dim wb As Excel.Applicati on
Set wb = New Excel.Applicati on
wb.Workbooks.Op en (fullnameofxls)
wb.activeworkbo ok.Activate

Set rCell = Cells.Find(What :=find_text, After:=ActiveCe ll, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xl ByRows, SearchDirection := _
xlNext, MatchCase:=Fals e, SearchFormat:=F alse)


If rCell Is Nothing Then
MsgBox "Data Missing"
End If
Jan 10 '07 #1
2 2347
hazzainuk
16 New Member
This isn't the best way to do it as if it does work it will invariably be that little bit slower. However you might want to try taking out the 'as range' you put after 'dim rcell'. If that doesn't work put 'as variant' after it. That may work. Type mismatch means you have the wrong datatype normally.
Jan 10 '07 #2
nit22
7 New Member
This isn't the best way to do it as if it does work it will invariably be that little bit slower. However you might want to try taking out the 'as range' you put after 'dim rcell'. If that doesn't work put 'as variant' after it. That may work. Type mismatch means you have the wrong datatype normally.

Thanks hazzainuk. It is working fine. Thanks a lot
Jan 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1471
by: Troy | last post by:
I have a class library (DLL) that I created and have been using for sometime in my various .NET applications. Recently, I have been having problems with what I believe is corruption (or a bug) of the DLL. The problem goes something like this: - I add new classes, methods, types, etc to the class library DLL and compile. The compile completes...
2
2722
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx. The problem is the article is in VisualBasic. I already get the collection to be recognized as a Data Source by the IDE. It populated the DataGrid...
1
3625
by: MyndPhlyp | last post by:
I am about to completely lose what is left of my poor mynd! The historical dissertation gets rather verbose, so I hope you can wade through it all. I really need some help on this one or I'm looking at rewriting all my hard work in something else (wasting probably a month or more). (If you want to run and hide now, the error message is "The...
4
5114
by: Polly | last post by:
I had a macro that ran a parameter query and created and opened an Excel file with the system date as part of the file name, but I had to change the file name by hand. So I converted the macro to code using tools-->references. The converted macro included the following statement: DoCmd.OutputTo acQuery, "qselLabelsBloodLog_output",...
9
2135
by: Adrian Dragomirescu | last post by:
Hello, I have the following problem: In my ASPX page is a button called "Import". The action of this button is to import a set of data in my database. I have to import big datasets and this opperation is time consuming (aproximativelly 3-4 hours). After an hour my page display the error: "The page cannot be displayed
5
3589
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This is used for comparing a value enterd by the user against the primary key in the SQL database. IF the VALUE ENTERED BY THE USER EXISTS IN THE DB , then THE ERROR MESSAGE OF THE COMPARE VALIDATOR SHOULD BE DISPLAYED. For this, I used the reference artiicle...
21
16554
by: rdemyan via AccessMonster.com | last post by:
Is there a way to get the internet date/time. I saw an article that uses WinSock, but WinSock doesn't seem to be available in Access. I want to verify that the date/time on the local PC running my application is correct, so I was hoping I could get the Internet date/time. I understand that there is a NTP protocol to do this. Thanks. ...
11
3064
by: Joseph S. | last post by:
Hi all, how do I avoid typing the keyword "$this->" every time I need to reference a member of a class inside the class? (coming from a world of cozy auto-complete enabled Java / .Net IDEs I find it a bit annoying) TIA, JS
1
3363
by: girays | last post by:
I have a template class which name is EntityRepository and when I compile this class I get no error. But when I use this class in a main method I get LNK2019 linking error. std::map object is used in EntityRepository template class. You can see the EntityRepository.h and EntityRepository.cpp and main method below: //EntityRepository.h...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.