|
이거 하나가지고 벌써 몇일짼지 모르겠어요 ㅠㅠ
해결의 실마리가 전혀 없네요 ㅠㅠ 제발 좀 도와주세요 엉엉
Variant xlApp, xlBooks, xlBook, xlSheet, xlSheets, VRange;
if (xlApp.IsEmpty()){
xlApp=Variant::CreateObject("Excel.Application.9");
}
xlApp.OlePropertySet("Visible", true);
xlBooks=xlApp.OlePropertyGet("Workbooks");
xlBooks.OleProcedure("add");
xlBook=xlBooks.OlePropertyGet("Item",1);
xlSheets=xlBook.OlePropertyGet("Worksheets");
xlSheet=xlSheets.OlePropertyGet("Item",1);
//아래의 내용은 엑셀로 잘 옮겨집니다. 문제가 전혀없이요..
VRange=xlSheet.OlePropertyGet("Range","A1");
VRange.OlePropertySet("Value", "날짜");
VRange=xlSheet.OlePropertyGet("Range","B1");
VRange.OlePropertySet("Value", "성명");
//그런데 이부분은 에러가 나네요
AnsiString a, b, date, name;
date = "2005-01-01";
name = "홍길동";
a = "A" + IntToStr(2);
a=""+a+"";
VRange=xlSheet.OlePropertyGet("Range",a);
VRange.OlePropertySet("Value",date);
b = "B" + IntToStr(2);
b=""+b+"";
VRange=xlSheet.OlePropertyGet("Range",b);
VRange.OlePropertySet("Value",name);
컴파일시는 문제가 전혀 없구요
실행해서 엑셀로 변환할때 "잘못된 변수 유형입니다" 라고 에러가 나면서
그 포인터가 sysvari.h 의
template <class P1>
Variant Variant::OlePropertyGet(const String& name, P1 p1)
{
TAutoArgs<1> args;
args[1] = p1;
return OlePropertyGet(name, static_cast<TAutoArgsBase*>(&args)); <--- 이부분에서 잡힙니다.
}
무슨 에러며 왜 나는것일까요?
고수닙들의 한수 가르침을 간절히 기다립니다. 꾸벅
|