Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics 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 June 18th, 2007, 10:42 AM
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding Excel Spreadsheet to form

I'd like to add a form containing an excel spreadsheet (to be used as a running log) to my application.

I can add the spreadsheet on the form as an active x type. I can relocate, resize with no issues. I cannot manipulate the cells programatically as I can an Excel worksheet running in its own application.

'Invalid Active X State' Exception keeps popping up.

I'm at a loss, your help would be appreciated.

Jason

 
Old June 18th, 2007, 01:16 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

When you do something like this, is the spreadsheet linked or embedded?
 
Old June 18th, 2007, 01:32 PM
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is an embedded spreadsheet. From the main form, the click-event of a button is meant to:
1. Initialize a new form.
2. Initialize a new activeX spreadsheet of type :spread = New AxOWC11.AxSpreadsheet

3. Add the spreadsheet control to the newform.

4. Resize and locate spreadsheet control.

5. Fill out cells with information stored in a two-dimensional array.

6. Then show the form containing the spreadsheet control modally.

Is this an AX Host thing? Initialization? OCXstate?

As I stated, I can resize and do some basic work with no problem, but any cell manipulation throws the 'invalid state' exception.

Furthermore, I tried to go ahead and create the spreadsheet control at design time and then went into its code in the 'Windows Form Designer' to see how the control creation was accomplished. I then tried to insert one line adding another worksheet and giving it a name. This addition caused the same exception to be thrown when I attempted to run the alteration with the debugger.

Any insight would be greatly aprreciated.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Excel Spreadsheet sektor VBScript 1 June 28th, 2010 11:13 PM
Excel Spreadsheet Help SteveV VBScript 0 October 10th, 2006 04:42 PM
Excel Spreadsheet Help SteveV BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 October 10th, 2006 04:41 PM
Excel Spreadsheet Help SteveV BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 October 10th, 2006 04:40 PM
merging data from web form to excel spreadsheet fmh002 Classic ASP Basics 1 June 30th, 2003 04:53 PM





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