473,395 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

2 excel tables in 1 MSHFlexGrid

39
Hello all!
I have a problem combining 2 tables from excel to my MSHFlexgrid. I've succeeded to show an excel table in my MSHFlexgrid using clipboard, but then I have to add a view columns from another excel table in that MSHFlexgrid. The problem is, how to add those columns in my MSHFlexgrid?
Or, is there any other way to open an excel table in MSHFlexgrid so I can add columns from another table easier?

Thank you very much for your help!


I have these codes to show an excel table:

Private Sub Command1_Click()
Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Open("C:\Documents and Settings\Administrator\My Documents\VB\dummy\PC1.xls")

Clipboard.Clear
With xlapp.ActiveWorkbook.ActiveSheet
.Range("A2:H7666").Copy
End With

With MSHFlexGrid1
.Redraw = False
.Row = 1
.Col = 0
.RowSel = MSHFlexGrid1.Rows - 1
.ColSel = MSHFlexGrid1.Cols - 1
.Clip = Replace(Clipboard.GetText, vbNewLine, vbCr)
.Col = 1
.Redraw = True
End With

xlapp.DisplayAlerts = False
xlbook.Close
xlapp.Application.Quit
Set xlbook = Nothing
Set xlapp = Nothing
End Sub

NAIRDA
May 29 '07 #1
0 1605

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: doller | last post by:
Hi Dear , I have a mshflexgrid control on the VB form having 200 rows .I need to add a row before or after the selected row in the grid. As wee do in excel we can add rows before or after...
4
by: giddy | last post by:
hie, does anyone know. how to use the MSHFlexGrid.. .in C#... and does'nt VS 2005 shipp with a NEW MSHflexGrid??? i hav VB6 installed to so does that create some conflict?? theres only ver. 6.0...
0
by: Thanu | last post by:
Hi, I want to import the background color of cells from excelsheet to Mshflexgrid in Vb6. I already have the code to import the contents from excel to mshflexgrid but i want to import the color...
2
by: nairda | last post by:
Hi, I'm Adrian from Indonesia. I have a problem using MSHFlexgrid in VB. I want to show a data from a single cell in MSHFlexgrid that I choose by mouse click in a textbox. The problem is, how to...
4
by: nairda | last post by:
Hi, I have a minor trouble in my program. I've one MSHFlexgrid to show all datas from an input form that I made. The problem occurs when I deleted one or more rows in the MSHFlexgrid and would like...
6
by: nairda | last post by:
Hi there, I need help processing data from Excel in VB. I have a MSHFlexgrid to show data extracted from Excel. I'm able to show a range of cells from Excel table to my Flexgrid, but that's it. The...
4
by: nairda | last post by:
Hi all, I have a MSHFlexgrid to show my database and some textboxes to show datas I choosed from MSHFlexgrid. I would like to know if there's a way to show a specific data I choosed from MSHF in...
2
by: WhiteShore | last post by:
hi there just wonder is it possible to save all the data item from mshflexgrid that has been retrieved from another table? let say i got 1 table called A and has been retrieved by mshflexgrid,...
2
Fary4u
by: Fary4u | last post by:
Hi it's my 1st post in VB, i'm trying to get data from ComboBox & result with MSHFlexGrid it's working fine there is no problem they only thing i need is Another ComboBox & ( result...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.