
Err 1004: Excel Workbook/Sheet Activate
Hello all,
I've written an app that was running FINE, "in field" for MONTHS
(Win'NT SP3 / VB5.0 SP3) before a problem SURFACED. The PC which is
running the code got Win'NT SP5 installed and <immediately> began
failing. The error which is returned is: RunTime error 1004
ACTIVATE WORKSHEET FAILED.
A partial listing of the code involved is listed below.
(Forgive the formatting,... it hard to make it FIT on a small screen)
To by quite honest, I was in the process of LEARNING how
Workbooks/Worksheets could be filled with data when I wrote this----
but, months later Id STILL write it the same way. Am I doing
something wrong? Or, in the wrong order? It feels like my app has
been chewed up in the wheels of MicroSoft OS progress (since the SP
install really caused the problem to surface).
Have any of you seen this SPECIFIC occurrence of the <dreaded> RunTime
1004 error?
Any/All help is GREATLY appreciated (as always) in advance,
--twk
********************
itTemp = Fix(itSheetQty / 40)
If itSheetQty Mod 40 <> 0 Then itTemp = itTemp + 1 'round up
'if NOT exact column size
For j = 0 To (itTemp - 1)
wbook.Sheets(iCurSheet).Cells(5, ((j + iCurCol) * 4) - 1).Value =
sItemNum
wbook.Sheets(iCurSheet).Cells(9, ((j + iCurCol) * 4) - 3).Value = 1
+ (40 * j) + (160 * i)
Next j
Else
If itSheetQty > 120 Then wbook.Sheets(iCurSheet).Cells(5, 15).Value
= sItemNum
If itSheetQty > 80 Then wbook.Sheets(iCurSheet).Cells(5, 11).Value =
sItemNum
If itSheetQty > 40 Then wbook.Sheets(iCurSheet).Cells(5, 7).Value =
sItemNum
wbook.Sheets(iCurSheet).Cells(5, 3).Value = sItemNum
End If
wbook.Sheets(iCurSheet).Activate
wbook.Sheets(iCurSheet).Cells(1, 3).Value = sgCustName
wbook.Sheets(iCurSheet).Cells(1, 9).Value = Mid$(Format$(Now), 1, 12)
wbook.Sheets(iCurSheet).Cells(3, 3).Value = iQty
wbook.Sheets(iCurSheet).Cells(3, 9).Value = sgOrderNumber
igItemCurSheetRowCol(iItemIndex - 1, 0) = iCurSheet - iCalcSheets + 1
'starting SHEET
igItemCurSheetRowCol(iItemIndex - 1, 1) = 9
'starting ROW
igItemCurSheetRowCol(iItemIndex - 1, 2) = 3
'starting COL
iCurSheet = iCurSheet + 1
********************
Sent via Deja.com http://www.*-*-*.com/
Before you buy.