Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2006, 12:03 PM
Authorized User
 
Join Date: Jun 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default after creating chart -> type mismatch error

Hi,

I'm generating a rather lengthy report in Excel with a lot of sections, drawing on data from Access. For each "section", for various sets of data, I need to generate a chart. So far I have been successful in generating the basics of the chart I want. The problem I am facing is this:

Since the charts are to be generated in a loop (one set of data is reported to excel -> chart created on that data -> loop back and next set of data is reported to excel -> chart created on this second set of data -> and so on), after the first chart is created, I am not able to reference ANY range object in my worksheet. If I comment out the generating of the chart (and do just the data reporting), the code works fine, so I know the syntax is okay. But if I ask the chart to be generated, the next instance of any code such as MySheet.Cells(...) or MySheet.Range(...) or MySheet.Rows(...) or MySheet.Columns(...) gives me a type mismatch error.

I'm sure it's a tiny piece of code I need to fix, or put it in, to return control to the "surface" of the worksheet, but I'm not able to figure it out.

Please help!

Thank you very much,
Kriti

 
Old July 18th, 2006, 12:12 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Try something like...

Worksheets("Sheet 1").Select

HTH

Mike

Mike
EchoVue.com
 
Old July 19th, 2006, 01:58 PM
Authorized User
 
Join Date: Jun 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

worked like a charm :) thank you so much.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Error-0x800A000D-Type mismatch kishy449 Classic ASP Basics 0 July 23rd, 2007 04:48 AM
Type Mismatch error Sheraz Khan Classic ASP Basics 0 May 16th, 2007 08:12 AM
Error 13 Type Mismatch lguzman Access VBA 2 January 6th, 2005 10:19 PM
Data Type mismatch error clueless_may Access VBA 1 May 5th, 2004 09:16 AM
Calling 3rd party ActiveX control -> type mismatch NoXuS C# 0 April 12th, 2004 06:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.