자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 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 15766
공지 유용한 관련 사이트 관리자2 2014.03.20 54580
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 97985
3139 TComport 64bit도 지원가능한가요? [2] 야크 2021.01.12 393
3138 MDI, CHILD 구성 DLL Form Close [1] 가나다 2021.01.11 1317
3137 ClientDataSet1.Data 문의드립니다 [2] 가나다 2021.01.06 1633
3136 10.4.1 에서 iOS Simulator 연결 시 디버그 모드만 동작되고 릴리즈 모드는 죽어버립니다. [2] file 막스뮐러 2021.01.04 396
3135 10.4 버전 DataSnap 연결 에러 질문드립니다. [4] syc 2020.06.25 618
3134 함수 동작중 서브폼 활성화시 먹통 현상 [1] 포세가이 2020.12.31 481
3133 TSQLQuery 사용시 operation not supported [1] 영들사랑 2020.12.30 396
3132 DATASNAP 사용 시 macOS에서 한글깨짐 문제 [1] file 8585 2020.12.29 211
3131 Delphi7 TcontrollScrollbar 관련 질문 [2] temp 2020.12.22 220
3130 구글 플레이스토어에 델파이 10.3.3 으로 만든 앱 배포 등록시 오류 밤바야 2020.12.28 172
3129 Delphi 10.4.1 Sydney - 위치변경후..주소변환 오류문의 [1] silkroad99 2020.12.04 301
3128 갤럭시 s20 삼성ui3.0 업데이트 후 앱 파이어몽키 앱 튕깁니다.?? kerry 2020.12.21 589
3127 macOS Big Sur 에서 [DCC Error] E2597 Undefined symbols for architecture arm64: 에러 나옵니다. file 텔로스김 2020.12.17 234
3126 FMX ICON파일 왜 안되죠? [1] 서준아빠 2020.12.11 280
3125 Multi Tenant 모드일때 REST 요청시 401에러 [1] 초보개발자 2020.12.07 215
3124 델파이10.3.3 API29, 안드로이드 10 변경 문의드립니다. [3] 쟝히 2020.11.23 423
3123 델파이 10 stringgrid 관련 [5] 개미 2020.12.02 290
3122 Andorid, IOS에서 Media (동영상)갤러리를 호출하는 방법 delphiman 2020.12.01 497
3121 10.4 앱 정상실행 후 다시 앱 실행하면 앱 꺼짐현상 문의드립니다. 쟝히 2020.12.01 248
3120 델파이 10 stringGrid 관련문의 [4] file 개미 2020.11.27 294