"Transition into COM context 0x465608 for this RuntimeCallableWrapper failed with the following error: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)). This is typically because the COM context 0x465608 where this RuntimeCallableWrapper was created has been disconnected or it is busy doing something else. Releasing the interfaces from the current COM context (COM context 0x465498). This may cause corruption or data loss. To avoid this problem, please ensure that all COM contexts/apartments/threads stay alive and are available for context transition, until the application is completely done with the RuntimeCallableWrappers that represents COM components that live inside them."
:
int i = 2;
while(i <= lastRowPOPT)
{
RefDocNo = poptSheet.Cells[i, 1].Text;
RefItem = poptSheet.Cells[i, 2].Text;
Plnt = poptSheet.Cells[i, 3].Text;
concat = RefDocNo + RefItem + Plnt;
poptSheet.Cells[i, 8] = concat;
poptSheet.Range["E" + i, "G" + i].Copy(Type.Missing);
poptSheet.Range["I" + i, "K" + i].PasteSpecial(Microsoft.Office.Interop.Excel.XlPasteType.xlPasteAll);
i++;
}
은 약 4700 개 행이 그것을 수행이 작업은 1000입니다 그리고 무언가, 그럼 그걸 던져 버린다. 또한 실행은 약 4 분 동안 지속되지만, 나는 그 시간의 대부분을 멈추게한다고 생각한다.
이 해결책은 일반적으로 보이지 않습니다. 해결하려고 시도한 상황에 대해 더 구체적으로 설명해주십시오. –