Is it possible to save (or send) the entire data in a MsFlexGrid control to EXCEL?
I need to save background colors, font styles, column widths etc. etc.
Dim xlAppl As Excel.Application
Set xlAppl = New Excel.Application
With xlAppl
.Visible = True
.Workbooks.Add
.ActiveSheet.Paste
End With
End Sub
Eric De Decker
vbg.be@vbgroup.nl
It is always useful to tell the line that gives you the error...
My guess is that you didn't include the Excel object library into your project.
Go to the Project Menu, Select References at the bottom of this menu and when they show up check the box for Microsoft Excel xx Object Library _________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
I've solved that problem but another occured...
it doesn't paste excel the correct data(grid's data)
it pastes the last text i've copied.
I understand that copying form msflexgrid procedure don't work...
I've solved that problem but another occured...
it doesn't paste excel the correct data(grid's data)
it pastes the last text i've copied.
I understand that copying from msflexgrid procedure don't work...
Hi.
You should try making a for---next to capture the data on your grid (and then pass it to variables or hidden text boxes) and then send it to Excel.
For nCounter = 1 to MSFlexGrid.Rows
MSFlexGrid.col = 1
x = MSFlexGrid.Text
-----
-----
Then send it to Excel...
Next
Search the Microsoft CD for a file called Vbaxl8.hlp (or something close). You'll find all you need to know.
By dzidze's advice, i tried to send all data to excel cell-by-cell
a simple for loop for columns, and one for rows inside it. And set excel's cell's all properties to flexgrids properties. like
excel.range(cells(i,j),(cells(i,j)).interior.color = msflexgrid.cellbackgroundcolor
and many lines for all other properties like fontbold italic etc.etc.
this seems to work but its very very slow even on a 860 Mhz Pentium III.
But i'm writing this program for a P75
I'm having the same problem with a similar project. The coding ain't that big, but it's true that it does seem to take some time. And I'm working on a P3-900.
If I ever find anything to make it faster I'll let you know.
Of course, if anybody has a solution, they can post it so we can see it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.