2009-12-23 17 views
4

이 예외가 발생하면 Excel 응용 프로그램 displayalert propery를 설정할 때 ... 왜?HRESULT 예외 : 0x800AC472

+0

에 대한

 Dim xlApp As Excel.Application = New Excel.Application Dim wb As Excel.Workbook = xlApp.Workbooks.Open(paths) Dim ws As Excel.Worksheet=wb.Worksheets(1) Dim range As Excel.Range = Nothing range = ws.UsedRange Dim wh As System.Array Dim retryRange As Boolean = False While retryRange Try wh = range.Value(Excel.XlRangeValueDataType.xlRangeValueDefault) retryRange = False Catch ex As Exception retryRange = True End Try End While 

VB, 그물 코드를 system.array에 입학 할 때까지 재 시도? 예외에 대해서? 당신의 코드? 등 ... –

+0

@ 토니 objExcelAppDataSheet.DisplayAlerts = True 은 예외적 인 경우에만 표시됩니다. objExcelAppDataSheet는 Excel 시트의 이름입니다. – Kiran

답변

4

속성 브라우저가 일시 중지 되었습니까? 그렇다면,이 도움이 될 수 있습니다 : HRESULT 800ac472 from set operations in Excel


한 가지 제안은 루프 내에서 try 블록 내부에 전화를 넣어 성공할 때까지 전화를 계속 시도하는 것입니다. 다음과 같이 보일 수 있습니다.

retry = True 

Do 
    Try 
     'Put your call here. 
     retry = False 
    Catch ex As Exception 
     'Need to try again, 
     'If this isn't the 0x800ac472 exception it should be re-thrown, 
     'Use Sleep(50) to reduce the number of retries, 
     'Use Exit Do or re-throw the exception to give up. 
    End Try 
While retry 

나는 VB에서 직접 작성하지 않으므로 실수를해서 사과드립니다.

+0

이전에 읽었는데 어떻게 할 수 없습니까? – Kiran

+0

하나의 제안은 루프 안에 try 블록 안에 호출을 넣고 성공할 때까지 호출을 계속 시도하는 것입니다. – richj

+0

@richj 잘 작동합니다. Thnx! – Kiran

0

vb.net 코드, 루프 range.value가 더 이상 데이터를 제공 할 수 richj 대답

+0

답변에 대한 설명을 추가하십시오. – drum

관련 문제