매크로 백그라운드에서 woorkbook을 열려고합니다. 사용자가 열린 파일 대화 상자를 종료하면 프로그램을 종료합니다.통합 문서 열기, 실패시 서브 종료/중단
그러나 그렇게 실패하고 모든 시도 ... 내가 지금까지 시도 무엇
' Get the file to open
tempFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
: 난 항상 "형식 불일치"오류가
' Catch abort of the open file dialog
If IsEmpty(tempFile) Then
End
End If
' Catch abort of the open file dialog
If IsEmpty(tempFile) Or Not tempFile Then
End
End If
' Catch abort of the open file dialog
If IsEmpty(tempFile) Or Not CBool(tempFile) Then
End
End If
' Catch abort of the open file dialog
If IsEmpty(tempFile) Or tempFile Like "false" Then
End
End If
상관없이.
If tempFile = "False" Then
: 당신은 아마 할 수있는 올바른 일이
dim tempFile as String
을 ... 할 경우, 다음과 같은 검사를 할 필요가 있기 때문에
추가적으로 http://msdn.microsoft.com/en-us/library/bb209892(v=office.12).aspx를 참조하십시오. 기사에 따르면 반환 유형은 변형입니다. – Fionnuala