자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 Q&A 이용 (제품 구매 고객 한정)

본 게시판은 개발자들이 자유롭게 질문과 답변을 공유하는 게시판입니다.
* 따라서 최대한 정중하게 질문을 올려 주세요.
* 질문을 상세히 작성해 주실 수록 좋은 답변이 올라 옵니다.
* 다른 분들도 참고할 수 있도록 결과 댓글 필수(또는 감사 댓글)
(결과 댓글을 달지 않는 경우 다음 질문에 대한 답변이 달리지 않는 불이익이 있을 수 있습니다.)
-----------------------------------------------------------------------------------------------

안녕하세요

10.1 도쿄버전 c++빌더 사용중입니다.

아래와 같이 특정 폴더에 있는 엑셀 파일을 열어서 수정하고 저장하는 기능을 구현중인데

"피호출자를 호출하지 못하였습니다."라는 오류 메시지가 뜨네요

그리고 작업관리자에 엑셀일 실행이 되고있어 일일일 수작업으로 지워줘야하구요

설정에 문제가 없는지 확인 부탁드립니다.

 


char dBuf[100];
int excel_col;
Variant excel_app;
Variant excel_book, excel_books;
Variant excel_sheet;
Variant excel_window;
Variant cells;
Variant Data;
Variant interior;
Variant column;
WideString ExcelData;
AnsiString asFileName;
Variant value;

 

String DefaultOpenPath={"C:\\ICS Default Set\\ICS Default Set.xlsx"};


void __fastcall TMainForm::Button_DefaultSaveClick(TObject *Sender)
{
  AnsiString TestStr, StrPoint;
  WideString Temp, SaveStr;
  char sTemp=0;


  Temp=DefaultOpenPath;

  excel_app=Variant::CreateObject("excel.application");                      //Excel 프로그램 실행
  excel_app.OlePropertySet("Visible", (Variant)false);                        //Excel 프로그램 Visible설정
  excel_app.OlePropertyGet("WorkBooks").OleProcedure("Open",Temp);
  excel_book=excel_app.OlePropertyGet("ActiveWorkbook");                     //현재 Active된 WorkBook 선택
  excel_sheet=excel_book.OlePropertyGet("ActiveSheet");                      // WorkBook에서 Acitve된 Sheet선택
  excel_app.OlePropertySet("DisplayAlerts", false);                                   //파일 저장 묻기 메시지 off
 

 

  TestStr=(Ru_MainForm->ComboBox_HighTemp->ItemIndex+80);
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",TempHighPoint[0], TempHighPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  if(Ru_MainForm->CheckBox_Fa1->Checked==false)    TestStr="OFF";
  else              TestStr="ON";
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",Fa1_SetupPoint[0], Fa1_SetupPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  if(Ru_MainForm->CheckBox_Fa5->Checked==false)    TestStr="OFF";
  else              TestStr="ON";
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",Fa5_SetupPoint[0], Fa5_SetupPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));


  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",AutoShutdownPoint[0], AutoShutdownPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  TestStr=(Ru_MainForm->ComboBox_ConDlInputUpper->ItemIndex+31)*-1;
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",DlInputUpperPoint[0], DlInputUpperPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  TestStr=(Ru_MainForm->ComboBox_ConDlInputLower->ItemIndex+50)*-1;
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",DlInputLowerPoint[0], DlInputLowerPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  SaveStr=DefaultOpenPath;
  excel_book.OleProcedure("SaveAs",SaveStr);
  excel_book.OleFunction("Close", (Variant)False);
  excel_sheet = Unassigned;
  excel_book = Unassigned;
  excel_app.OleFunction("Quit");
  excel_app = Unassigned;
}

 

번호 제목 글쓴이 날짜 조회 수
공지 [프로그래밍 강의] 2021.6~2021.12 관리자 2015.01.22 15759
공지 유용한 관련 사이트 관리자2 2014.03.20 54576
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 97972
3279 TwineCompile 에러가 발생 했는데, 수정은 어떻게 하나요? 하루 2021.01.19 532
3278 델파이 10.4.1 환경에서 IOS Device 14.4 디버깅 관련 문의 [2] 2an 2021.02.24 926
3277 [공유] TServerSocket, TClientSocket은 어떻게 등록하나요? file Humphery 2015.03.24 3010
3276 델파이 10.3.3에서 컴파일된 apk 안드로이드 11에서 로드 안되는 현상입니다. [7] 돌떵이이11 2021.01.28 1633
3275 델파이 C/S프로그램을 웹으로 전환해서 보여주는 방법 연일하 2015.10.28 2661
3274 [10.4 시드니 신기능 Q&A] Thinfinity VirtualUI(데스크탑 앱을 웹브라우저에서 실행 솔루션)의 한글 입력이 매끄럽지 못합니다. 험프리 2020.06.10 1188
3273 Timage Picture.data : Access Violation 문의 [1] file 유경아빠 2021.08.31 1534
3272 JSON 파라메타 한글 문제 [2] file 케이피 2021.08.26 1773
3271 델파이(안드로이드) , cubrid 연결 문의. [3] Hoony 2021.08.09 1279
3270 자동차 인식 방법에 대한 질문입니다. [4] file 거북선생 2021.08.25 1630
3269 델파이 10.4 patch하니 실행이 안됩니다. [7] file 갈굼정미 2021.08.26 1602
3268 UC-win/Road에서 앞차와 거리를 측정하려고 합니다. [1] jhjh 2021.08.25 2357
3267 [질문] SMS 문자보내기 창으로 이동하는 방법 [1] 화현 2021.07.18 1428
3266 10.4 버젼 [1] 시작.. 2021.08.17 1180
3265 delphi 10.2 버전에서 크로미움으로 Chrome 브라우저를 사용중인데..mp4 같은 동영상이 실행이 안됩니다. [1] 미스터리 2021.07.11 1838
3264 [질문] 이미지를 datasnap을 사용하여 서버로 전송밥법 [2] 화현 2021.08.08 1265
3263 데이타베이스 파이어버드인데 REST API RAD서버 구축 가능할까요? [4] 케이피 2021.08.15 1400
3262 RAD 서버 배포 오류 [2] file 케이피 2021.08.17 1187
3261 (팁) TRESTRequest Post방식 파일업로드와 함께 텍스트 변수 전송 10.4에서만 성공 미스터몽키 2021.08.18 6383
3260 RAD 서버 운영환경에 설치중 오류 [2] file 노란바나나 2019.10.30 1293