문제

I am trying to check against two value in a row, if that check passes then I want to copy the entire row at the end of the sheet.

LAST_ROW = 4488
CURRENT_ROW = 3
NEW_ROW = LAST_ROW + 2

while CURRENT_ROW <= LAST_ROW:
    if Cell(CURRENT_ROW, 63).value == "12" or Cell(CURRENT_ROW, 63).value == 12:
        if Cell(CURRENT_ROW, 65).value == "12" or Cell(CURRENT_ROW, 63).value == 12:
            for column in range(200):
                Cell(NEW_ROW, column).copy_from(Cell(CURRENT_ROW, column))
            NEW_ROW += 1
    CURRENT_ROW += 1

I get an "Exception: Exception from HRESULT: 0x800A03EC" error from the line "Cell(NEW_ROW..." and I am not sure why. Thank you as I have little to no experience with python and none with Data nitro.

도움이 되었습니까?

해결책 2

HRESULT: 0x800A03EC is an unknown (to VB.Net) COM error. This usually happens when Excel throws some error because your input or parameters were wrong or didn't work. I suggest you test your code in Excel VBA to make sure it works. It will be easier to diagnose there.

다른 팁

Just incase anyone else stumbles upon this. Excel column and row values start at 1 not 0.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top