Hello ,
i would like to import an excel file into a MSFlexGrid but when I try the Datasource way it doesn't work. Does anyone has any code available?
Printable View
Hello ,
i would like to import an excel file into a MSFlexGrid but when I try the Datasource way it doesn't work. Does anyone has any code available?
Does this help?
http://www.freevbcode.com/ShowCode.asp?ID=7354
you will have to extract the code from the part where it is importing to excel...
Hope it helps...
thanks, but it doesn't work.
What exactly doesn't work? Are you getting any error messages? or is there any code missing?Quote:
thanks, but it doesn't work.
I took a screenshot of the error.
Here is the screenshot:
Oh, Ok...
After you open the project, don't run it. Like I said in my previous post you will have to extract the code...
Check out the code in the form ExcelImportDataFile under
Public Sub ReadExcelFile()
End Sub
Hope this helps...
See these examples
http://www.vbforums.com/showthread.php?t=393082
Quote:
Originally Posted by koolsid
I know this example and I extracted the code yesterday. I have the same problem.
That's why I wrote that I have problems with the DataSource method.
Quote:
Originally Posted by jcis
This sample helped me a little but when I don't know how many cells to copy, what could I do?
@jcis: That's a damn neat code :D
So you want the Flexgrid to look exactly like the Workseet? If so there is a property of the worksheet i think, something like UsedRange, you can send that to Clipboard and use UsedRange.Columns or something like that to get the columns and row count, if this doen't work you can still do it Splitting the string in the Cliopboard, the separator is vbTab. When you have as many rows and cols are needed then paste in the Flex.Quote:
Originally Posted by DarkX_Greece