Where can I find DataGridView for VBA? DataGridView vs DataGrid?

Where can I find DataGridView for VBA? DataGridView vs DataGrid?

Post by QXZp » Tue, 09 Jan 2007 21:54:00


Hi all,

I need a good table control to put on a Word VBA form for simple but
reliable data entry by user. Only small amounts of data are expected.

I just downloaded Vis Stud Express VB and see they have a **DataGridView**
table control. I don't need to connect with a DB or anything sophisticated
like that; I just need to allow VBA and the user to write and read data
to/from the cells and do a bit of formatting and processing.

With some effort I managed to find the OCXs for the MS flex grid and MS data
grid controls, but what is the name of the file for DataGridView? I have .Net
2.0 installed, but couldn't find any hint of the DataGridView in the
Additional Controls dialog box.

Where can find the DataGridView OCX file, if such exists? Can I use
DataGridView with VBA?

Does DataGridView have any minuses wrt Data Grid?

I need some basic samples using DataGridView and Data Grid for simple stuff
like initialisation, reading and writing cells, setting table read-only and
R-W, some formatting. What about compatibility? Can I run such a table on any
Office / Windows platform?

I noticed something funny with data grid and flex grid. Although I managed
to access the OCX and got the tool displayed on the tool box, when I tried to
drag it to a Word VBA form, it told me something about not having a license.
Happened on both my PCs. So that was when I decided to install Visual Studio
Express VB on one of the PCs, and then lo and behold, I found I could drag
the data grid onto a form with no problems. Then I decided to see what would
happen if I copy the new Word doc with the form with the data grid in it, to
the other PC, which does not have Vis Basic installed. Now that also worked!
Seems that a form with a control on it takes the control's license with it
wherever it goes. Is that what's happening here?

But most important, where can I find DataGridView for VB?

tia,

- avi
 
 
 

Where can I find DataGridView for VBA? DataGridView vs DataGrid?

Post by QXZp » Tue, 09 Jan 2007 21:57:01

Sorry - my final line was supposed to be:

"But most important, where can I find DataGridView for VBA?"

tia

- avi

 
 
 

Where can I find DataGridView for VBA? DataGridView vs DataGrid?

Post by Cindy M » Wed, 10 Jan 2007 01:30:13

Hi =?Utf-8?B?QXZp?=,

There is no "DataGridView" control for VBA. This is a Visual Studio "thingy",
and Visual Studio means .NET. VBA is at the opposite end of the spectrum - it's
COM-based and doesn't know anything about .NET.

Theoretically, it would be possible to put a COM-Wrapper around the .NET control
in order to use it like an ActiveX control in a form. But VBA wouldn't have any
way to "talk to it" in order to do anything with the data grid. At the very
least, you'd need a COM-enabled .NET dll to call back to. It could all get
extremely complicated... And certainly goes beyond the scope of this newsgroup.


Cindy Meister
INTER-Solutions, Switzerland
http://www.yqcomputer.com/ (last update Jun 17 2005)
http://www.yqcomputer.com/

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
 
 

Where can I find DataGridView for VBA? DataGridView vs DataGrid?

Post by Doug Robbi » Wed, 10 Jan 2007 03:29:37

I would use textboxes and a listbox with Add, Edit and Delete Command
buttons.

The user would enter their data into the text boxes and then click on the
Add button which would add that record into the Listbox and clear the
textboxes ready for entry of the next lot of data. If they selected an item
in the List, and click on the Edit button, it would populate the textboxes
with that record so that it could be edited, or if they clicked on the
deleted button, it would delete the selected item from the listbox.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP