아하
생활

생활꿀팁

탈퇴한 사용자
탈퇴한 사용자

델파이에서 엑셀을 실행시키면 오류가 나네요

델파이에서 단순히 stringgrid에 있는 내용을

엑셀로 전환하기 위해서 엑셀을 실행시키면 오류가 나요

오류가 나는 소스는

Try
XL:=CreateOLEObject('Excel.Application'); //여기서 오류
Except
ShowMessage('엑셀이 설치되어 있지 않습니다.');
Exit;
End;

엑셀 2010은 되는데 2016이 안되서 이해가 안되네요

55글자 더 채워주세요.
1개의 답변이 있어요!
  • 탈퇴한 사용자
    탈퇴한 사용자

    안녕하세요?

    엑셀이 2016부터 명칭이 바껴서 아마 오류가 나는걸겁니다

    밑에 참고해서 적용시켜보시기 바랍니다

    If ClassIdExists("Excel.Application") Then Set xl = CreateObject("Excel.Application") Else If ClassIdExists("Excel.Application.16") Then Set xl = CreateObject("Excel.Application.16") Else MsgBox "Can't locate Excel class." End