R
R Kalal
From VB.Net(2003) I want to be able to iterate through all cells "c", in a
runtime defined range object(excel 2003). However, when the xTest sub is
run, it generates a member not found error on the line( for each c in
objrange.cells).
Any help would be greatly appreciated.
Thanks Rick
declarations
Private objExcel As Microsoft.Office.Interop.Excel.Application
Private objWorkbook As Microsoft.Office.Interop.Excel.Workbook
Private objRange As Microsoft.Office.Interop.Excel.Range
function xTest(strSomeRange as string) as variant
Dim c As object
objExcel = New Microsoft.Office.Interop.Excel.Application
objExcel.Visible = True
objWorkbook = objExcel.Workbooks.Add()
objRange = objWorkbook.ActiveSheet.Range(strSomeRange)
For Each c In objRange.Cells ' this is where the error occurs.
'some code goes here and sets a format based on the cells content
Next c
End Sub
runtime defined range object(excel 2003). However, when the xTest sub is
run, it generates a member not found error on the line( for each c in
objrange.cells).
Any help would be greatly appreciated.
Thanks Rick
declarations
Private objExcel As Microsoft.Office.Interop.Excel.Application
Private objWorkbook As Microsoft.Office.Interop.Excel.Workbook
Private objRange As Microsoft.Office.Interop.Excel.Range
function xTest(strSomeRange as string) as variant
Dim c As object
objExcel = New Microsoft.Office.Interop.Excel.Application
objExcel.Visible = True
objWorkbook = objExcel.Workbooks.Add()
objRange = objWorkbook.ActiveSheet.Range(strSomeRange)
For Each c In objRange.Cells ' this is where the error occurs.
'some code goes here and sets a format based on the cells content
Next c
End Sub