Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2007

Tip: Looking for answers? Try searching our database.

Type Mismatch

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stout - 31 May 2007 18:17 GMT
This gives me a type mismatch in Excel 2007 but not in 2003

If Cells(MyRow, MyCol) = 0 Or IsEmpty(Cells(MyRow, MyCol)) Then

Does anyone know why?

Thanks.

Bill
Tom Ogilvy - 31 May 2007 18:35 GMT
What does Cells(MyRow,MyCol) contain when you get the type mismatch error.  

If it contains an Excel Error Value, that can cause that problem (but I
would expect it in any version).  

In Excel 97, comparing a string to a Number (zero in this case) would raise
a type mismatch - I don't have xl2007 to test, but maybe they when backwards
in of the fix to that problem.

You could try

If Cells(MyRow, MyCol).Text = "0" Or IsEmpty(Cells(MyRow, MyCol)) Then

Signature

Regards,
Tom Ogilvy

> This gives me a type mismatch in Excel 2007 but not in 2003
>
[quoted text clipped - 5 lines]
>
> Bill
Stout - 31 May 2007 22:25 GMT
On May 31, 1:35 pm, Tom Ogilvy <TomOgi...@discussions.microsoft.com>
wrote:
> What does Cells(MyRow,MyCol) contain when you get the type mismatch error.
>
[quoted text clipped - 22 lines]
>
> > Bill

Thanks man...that was it.  It had errors...macros were not enabled.

I have another question now...I get a 1004 error on this line:

sheets(targetsheet).ChartObjects.Delete

Once again, only in 2007.  I can comment it out and it seems to run
correctly but I can't find why this doesn't work.

Thanks again.

Bill
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.