LindaRichard
Programmer
Hi,
I have some code that adds columns to an excel sheet.
My problem is when I go behond the Z column, I get an error.
I know that Excel numbers form A...Z the AA AB etc...
My question is does anyone know of a different way of accessing each
column and avoiding writing a complex string building expression
Here is my code.
Thanks for your help
Linda
*----------------------------------------------------------------
*create excel object
*----------------------------------------------------------------
goExcel = CREATEOBJECT("Excel.application"
*----------------------------------------------------------------
*open a workbook
*----------------------------------------------------------------
WITH goExcel
*add workbook sheets (this adds 3 sheets by default)
.Application.Workbooks.Add
*delete the other 2 sheets don't need them
*turn the warning message off
.APPLICATION.DisplayAlerts = 0
*delete sheet2
.Worksheets("Sheet2".DELETE
*delete sheet3
.Worksheets("Sheet3".DELETE
*turn the warning message on again
.APPLICATION.DisplayAlerts = 1
*make the first sheet the active one
.Application.Worksheets("Sheet1".Activate && Select sheet
giLineCount=1
*print the field titles
FOR t=1 TO giSelectedNumber
*print the field label
.RANGE(CHR(96+t)+ALLTRIM(STR(giLineCount))).VALUE=gaSelectedFieldName(t)
NEXT t
ENDWITH
I have some code that adds columns to an excel sheet.
My problem is when I go behond the Z column, I get an error.
I know that Excel numbers form A...Z the AA AB etc...
My question is does anyone know of a different way of accessing each
column and avoiding writing a complex string building expression
Here is my code.
Thanks for your help
Linda
*----------------------------------------------------------------
*create excel object
*----------------------------------------------------------------
goExcel = CREATEOBJECT("Excel.application"
*----------------------------------------------------------------
*open a workbook
*----------------------------------------------------------------
WITH goExcel
*add workbook sheets (this adds 3 sheets by default)
.Application.Workbooks.Add
*delete the other 2 sheets don't need them
*turn the warning message off
.APPLICATION.DisplayAlerts = 0
*delete sheet2
.Worksheets("Sheet2".DELETE
*delete sheet3
.Worksheets("Sheet3".DELETE
*turn the warning message on again
.APPLICATION.DisplayAlerts = 1
*make the first sheet the active one
.Application.Worksheets("Sheet1".Activate && Select sheet
giLineCount=1
*print the field titles
FOR t=1 TO giSelectedNumber
*print the field label
.RANGE(CHR(96+t)+ALLTRIM(STR(giLineCount))).VALUE=gaSelectedFieldName(t)
NEXT t
ENDWITH