finding number of rows and columns

04-25-2001, 04:24 AM
I am creating a web page builder specific to its parent program, one of the functions I would like it to do is automatically insert a table with dde links to an excel spread sheet.

I know how to insert the table, but I dont know how to find the number of rows and columns in the excel spread sheet. I would preferably like to have the user do this by clicking on the file name via the commondialog for ease of use, and perhaps using the OLE???

thanks for any help

04-25-2001, 05:46 AM
OK I've got a way to find out the rows and columns(below), but it doesn't allow for people leaving the odd cell empty so if anyone knows a proper function to find out please let me know
<pre>Dim xlSheet As Workbook

Private Sub Form_Load()
Dim intRow As Integer
Dim intColumn As Integer

Set xlSheet = GetObject(CommonDialog1.FileName)
intRow = intRow + 1
Loop Until xlSheet.Worksheets(1).Range(Chr(intRow + 64) & 1).Value = ""
intColumn = intColumn + 1
Loop Until xlSheet.Worksheets(1).Range("A" & intColumn).Value = ""
Text1.Text = intRow - 1 & " , " & intColumn - 1
End Sub</pre>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum