Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OLE Excel data handling from VB

Dear Experts,

We have developed a scientific application using VB6. The output,
which contains several columns having numeric data delimited by <tab
char, is displayed in a multiline text box control. We wish to copy
the data of a certain column (like, Block selected mode in TextPad)
only. The text box control does not allow this feature at all.

We decided to use Excel as an OLE container(embedded interface of
Excel) to display output in columns. I am using the following code to
populate the Excel.

OLE1.CreateEmbed "", "Excel.Sheet.8"

Set objExcel = OLE1.object.Parent 'Now you can use the type lib
Set objWB = OLE1.object 'will return a workbook object
Set objSheet = objWB.ActiveSheet 'will return a worksheet object

'objSheet.Cells(1, 1) = "Data 1"

Can anybody please tell the following things:

1). A more better way to send data to Excel from VB in a junk or
atleast for the whole row instead of cell by cell.

2). How to allow users to edit the data in the cells without opening
the separate instance of the Excel interface(perhaps called in-line
editing).

3). Allow user to select any row/col to perform cut, copy or paste
operation.

Any help in this regard will be highly appreciated.

Regards,

Faiz
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default OLE Excel data handling from VB

Faiz -

I'm only slowly coming up to speed in VB, but isn't there a FlexGrid
control that would do the same thing as an embedded Excel object?
Without knowing any better, I'd assume that would be easier to use.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Faiz wrote:
Dear Experts,

We have developed a scientific application using VB6. The output,
which contains several columns having numeric data delimited by <tab
char, is displayed in a multiline text box control. We wish to copy
the data of a certain column (like, Block selected mode in TextPad)
only. The text box control does not allow this feature at all.

We decided to use Excel as an OLE container(embedded interface of
Excel) to display output in columns. I am using the following code to
populate the Excel.

OLE1.CreateEmbed "", "Excel.Sheet.8"

Set objExcel = OLE1.object.Parent 'Now you can use the type lib
Set objWB = OLE1.object 'will return a workbook object
Set objSheet = objWB.ActiveSheet 'will return a worksheet object

'objSheet.Cells(1, 1) = "Data 1"

Can anybody please tell the following things:

1). A more better way to send data to Excel from VB in a junk or
atleast for the whole row instead of cell by cell.

2). How to allow users to edit the data in the cells without opening
the separate instance of the Excel interface(perhaps called in-line
editing).

3). Allow user to select any row/col to perform cut, copy or paste
operation.

Any help in this regard will be highly appreciated.

Regards,

Faiz


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OLE Excel data handling from VB

assume your data is in a single column - two dimenional array

dim myarray(1 to numrows, 1 to 1)


so for example

if myarray is 1 x 10, 1 x 1

Cells(1,1).Resize(10,1).Value = myarray

Assuming your enter in each cell is something like

Data1 tab data2 tab data2 tab

you can go into excel and do Data=Text to column, select delimited, set Tab
as the delimiter and your data will be parsed into separate columns.

If you turn the macro recorder on while you do this, you will get the code
to run the command (the interactive dialog will not be displayed when run in
code).

Regards,
Tom Ogilvy

"Faiz" wrote in message
om...
Dear Experts,

We have developed a scientific application using VB6. The output,
which contains several columns having numeric data delimited by <tab
char, is displayed in a multiline text box control. We wish to copy
the data of a certain column (like, Block selected mode in TextPad)
only. The text box control does not allow this feature at all.

We decided to use Excel as an OLE container(embedded interface of
Excel) to display output in columns. I am using the following code to
populate the Excel.

OLE1.CreateEmbed "", "Excel.Sheet.8"

Set objExcel = OLE1.object.Parent 'Now you can use the type lib
Set objWB = OLE1.object 'will return a workbook object
Set objSheet = objWB.ActiveSheet 'will return a worksheet object

'objSheet.Cells(1, 1) = "Data 1"

Can anybody please tell the following things:

1). A more better way to send data to Excel from VB in a junk or
atleast for the whole row instead of cell by cell.

2). How to allow users to edit the data in the cells without opening
the separate instance of the Excel interface(perhaps called in-line
editing).

3). Allow user to select any row/col to perform cut, copy or paste
operation.

Any help in this regard will be highly appreciated.

Regards,

Faiz



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Handling blank data points jo2109 Charts and Charting in Excel 3 March 7th 09 09:01 AM
Handling cells with multiple data entries Emily Excel Worksheet Functions 2 July 15th 08 08:53 PM
Series Lines Handling of Missing Data [email protected] Charts and Charting in Excel 1 December 8th 05 10:24 PM
Handling "Blank Entries" through Data Validation Jai Excel Discussion (Misc queries) 2 August 19th 05 04:21 PM
Mixed Data Handling easy Charts and Charting in Excel 2 March 16th 05 03:21 AM


All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"