Excel woes

I have the following script, which doesn’t do much, it opens excel and then prints in the cell nam into the right cell, only A1-3 through to E1-3


set excelFile to "Shared G4 HD:Users:karrenmay:Desktop:test.xls"
set columnList to {"A", "B", "C", "D", "E"}

tell application "Microsoft Excel"
	launch
	Open excelFile
	repeat with j from 1 to (count columnList)
		set columnItem to item j of columnList
		repeat with i from 1 to 3
			
			
			set valueOf to columnItem & i
			
			display dialog valueOf
			set Value of Cell valueOf to valueOf
			
			
		end repeat
	end repeat
end tell

If you can it would be good if you coule run it and see my problem, i cant explain it.

Also i would like to close the file and save it but i dont know how, have tried things like save current document and so on. But no luck

Any ideas?

Your problem is that when you get to column C, Excel interprets “C1” as meaning Column 1 rather than cell C1.

One fix is to use absolute references in the form $A$1 rather than A1:

tell application "Microsoft Excel"
	repeat with aColumn in columnList
		repeat with i from 1 to 3

			set theCell to "$" & aColumn & "$" & i
			set Value of Cell theCell to aColumn & i
			
		end repeat
	end repeat
end tell

i have solved the problem and now use the R1C1 method, namely set the forumla of row 1 column 1.


set formula of "R1C1" to "hello"