I am writing a macro through IBM Reflection VBA that utilizes an Excel file to provide the information it needs. And what I am trying to do is from the Reflection Session the macro gets information from an Excel file and inputs it into Reflection and proceeds to perform its various functions. The problem that I am having is that when the macro is done I want it to move to the next cell down and start all over again. In other words I want the macro to move down a list, who's range varies depending on the amount of information. So, what am I doing wrong? I keep trying to do this and have probably come close to the correct answer but everytime try to do this it never works. Either it completly doesn't do what I wanted it to do or I get a varying amount of error messages. I have provided the macro for you to see and make changes to. Also keep in mind that I am fairly new to VBA and some of the jargon is a little foriegn to me. Thanks!
Dim CellContents As String
Dim LocationCount As Integer
Set ExcelApp = Excel.Application
Set ExcelWorkbook = ExcelApp.Workbooks.Open("R:\My Documents\Location Codes To Delete Rates.xls")
LocationCount = 2
StartPos = ExcelApp.ActiveSheets(Sheet1).Range("A & LocationCount")
With Session
If Range("A & LocationCount") <> "" Then
Do While CellContents <> ""
.RunMacro "NewMacros.Location_Code_Input", ""
Let LocationCount = LocationCount + 1
Loop
End If
End With
Dim CellContents As String
Dim LocationCount As Integer
Set ExcelApp = Excel.Application
Set ExcelWorkbook = ExcelApp.Workbooks.Open("R:\My Documents\Location Codes To Delete Rates.xls")
LocationCount = 2
StartPos = ExcelApp.ActiveSheets(Sheet1).Range("A & LocationCount")
With Session
If Range("A & LocationCount") <> "" Then
Do While CellContents <> ""
.RunMacro "NewMacros.Location_Code_Input", ""
Let LocationCount = LocationCount + 1
Loop
End If
End With