H
Hal2604 via AccessMonster.com
I am linking a report to excel & trying to loop through labels on the report
labeled lbl20 - 27 & txt20-27. My report comes up blank when there is data
in excel. My code below is lengthy but I figured it was helpful to see it
all:
Do While ClosingCount <= 27 And PercentVAR > 4.49 / 100
XLAPP.Windows("TotalErrors.xls").Activate
XLAPP.sheets("Summary").Select
XLAPP.Range("B" & CellNum).Select
PercentVAR = XLAPP.activecell
If XLAPP.activecell >= 4.49 / 100 Then
XLAPP.activecell.Offset(rowOffset:=0, columnOffset:=-1).Activate
Call CheckCenter(XLAPP.activecell) 'NJM 12/10
If bCenter = False Then 'closing errors
XLAPP.activecell.Offset(rowOffset:=0, columnOffset:=1).Activate
Report!memorandumNJM.Activate
tempT = "txt" & ClosingCount
memorandumNJM.Controls(tempT).Caption = XLAPP.activecell
XLAPP.Workbooks("TotalErrors.xls").Activate
XLAPP.Windows("TotalErrors.xls").Activate
XLAPP.strCellLoc = XLAPP.activecell
XLAPP.activecell.Offset(rowOffset:=0, columnOffset:=-1).Activate
Report!memorandumNJM.Activate
tempL = "lbl" & ClosingCount
memorandumNJM.Controls(tempL).Caption = XLAPP.activecell
memorandumNJM.Controls(tempT).Caption = Format(memorandumNJM.
Controls(tempT).Caption, "#0%")
ClosingCount = ClosingCount + 1
End If
End If
CellNum = CellNum + 1
Loop
Thank - You
Holly
labeled lbl20 - 27 & txt20-27. My report comes up blank when there is data
in excel. My code below is lengthy but I figured it was helpful to see it
all:
Do While ClosingCount <= 27 And PercentVAR > 4.49 / 100
XLAPP.Windows("TotalErrors.xls").Activate
XLAPP.sheets("Summary").Select
XLAPP.Range("B" & CellNum).Select
PercentVAR = XLAPP.activecell
If XLAPP.activecell >= 4.49 / 100 Then
XLAPP.activecell.Offset(rowOffset:=0, columnOffset:=-1).Activate
Call CheckCenter(XLAPP.activecell) 'NJM 12/10
If bCenter = False Then 'closing errors
XLAPP.activecell.Offset(rowOffset:=0, columnOffset:=1).Activate
Report!memorandumNJM.Activate
tempT = "txt" & ClosingCount
memorandumNJM.Controls(tempT).Caption = XLAPP.activecell
XLAPP.Workbooks("TotalErrors.xls").Activate
XLAPP.Windows("TotalErrors.xls").Activate
XLAPP.strCellLoc = XLAPP.activecell
XLAPP.activecell.Offset(rowOffset:=0, columnOffset:=-1).Activate
Report!memorandumNJM.Activate
tempL = "lbl" & ClosingCount
memorandumNJM.Controls(tempL).Caption = XLAPP.activecell
memorandumNJM.Controls(tempT).Caption = Format(memorandumNJM.
Controls(tempT).Caption, "#0%")
ClosingCount = ClosingCount + 1
End If
End If
CellNum = CellNum + 1
Loop
Thank - You
Holly