자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 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 15769
공지 유용한 관련 사이트 관리자2 2014.03.20 54583
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 98003
84 no matching member function for call to 'LoadFromFile' 문의드립니다. [2] ip7203 2019.05.30 373
83 C++ Builder 무료에디션 라이선스 문의 쌉웨얼 2019.06.21 179
82 Rio10.3.2 업그래이드 후 코드인사이트 먹통 [1] file 개성산전 2019.07.19 360
81 RAD Studio 10.3.2 사용 문의입니다. [1] file ip7203 2019.07.26 347
80 C 프로그램 콘솔 입니다. [2] 겨울잠안자는곰 2019.07.30 244
79 C++ Builder 6의 project에서 네트워크 공유폴더 경로에 있는 Source파일이 열리지 않습니다. [3] file 영우CnI 2019.08.09 594
78 exception 문의입니다. file ip7203 2019.08.14 129
77 실시간 Syntax Error Check 겨울잠안자는곰 2019.08.19 118
76 라이센스 문제 이영진 2019.08.22 161
75 안드로이드앱 개발 시 파일저장 방법 [1] Xownd 2019.08.22 192
74 rs-232 통신이 안됩니다. [1] 쿠리 2019.09.27 202
73 RAD Studio 10.3.2 Code Insight의 지속적인 문제 [2] 포비 2019.10.02 395
72 문자열에 들어있는 &는 표현이 안되나요? [2] 토끼왕 2019.10.09 200
71 C++ Builder에서 리팩토링 file 겨울잠안자는곰 2019.10.09 122
70 Rio Trial은 tlb 파일 import가 안되나요? [1] 쉬폰 2019.10.15 215
69 Find declaration 동작 이상 등 버그 [3] 아루스 2019.10.24 193
68 TImage->Width와 실제 값 차이 문의 [4] file icj 2019.11.13 188
67 [bcc32c Error] GdiplusPath.h(146) reference to 'byte' is ambiguous [2] 하루 2019.11.15 757
66 indy udp 서버로 수신한 데이터에 대한 응답을 udp로 보내는 echo 서버를 만들었는데 [2] 금목암 2019.11.15 832
65 TSaveEvent로 jpg저장하는 기능관련 문의의 글 [1] file 영우CnI 2019.11.28 92