при выводе в excel вылезает ошибка - вопрос №2663604

void record(String *aray, int t)
{
int i;
Variant App, Bks, Bk, Shts, Sht, Sht1, Cll;
AnsiString vAsCurDir=GetCurrentDir();
App=CreateOleObject(«Excel.Application»);
App.OlePropertySet(«Visible», true);
Bks=App.OlePropertyGet(«Workbooks»);
App.OlePropertySet(«SheetsInNewWorkbook», 3);
Bks.OleProcedure(«Add»);
Bk=Bks.OlePropertyGet(«Item»,1);
Shts=Bk.OlePropertyGet(«Worksheets»);
Sht=Shts.OlePropertyGet(«Item»,1);
i=1;
int j=1;
String ff = aray[t];
UnicodeString str = ff.c_str();



while (j<3)
{
while (i<11)
{
Cll=Sht.OlePropertyGet(«Cells»).OlePropertyGet(«Item»,i,j);
Cll.OlePropertySet(«Value», WideString(«lol»));
i++;
};
j++;
i=1;
}
Shts=Bk.OlePropertyGet(«Worksheets»);
Sht=Shts.OlePropertyGet(«Item»,2);
Sht.OleProcedure(«Activate»);
i=1;
j=1;
while (j<34)
{
while (i<11)
{
Cll=Sht.OlePropertyGet(«Cells»).OlePropertyGet(«Item»,i,j);
Cll.OlePropertySet(«Value», WideString(aray[i]));
i++;
};
j++;
i=1;
}
Shts=Bk.OlePropertyGet(«Worksheets»);
Sht=Shts.OlePropertyGet(«Item»,3);
i=1;
j=1;
while (j<34)
{
while (i<11)
{
Cll=Sht.OlePropertyGet(«Cells»).OlePropertyGet(«Item»,i,j);
Cll.OlePropertySet(«Value», WideString(aray[i]));
i++;
};
j++;
i=1;
}
String h=«rr»;
App.OlePropertySet(«DisplayAlerts»,false);
AnsiString vAsCurDir1=vAsCurDir+"\\amount.xls";
Bk.OleProcedure(«SaveAs», WideString(str + h + ".xlsx"));
App.OleProcedure(«Quit»);

}изображение из вопроса
19.11.17
0 ответов
Ответов пока нет
Посмотреть всех экспертов из раздела Технологии > C/C++
Пользуйтесь нашим приложением Доступно на Google Play Загрузите в App Store