I'm trying to convert Excel file to DBF. So i'm using ActiveQt FrameWork.
So i generated Excel namespace by using dumpcpp tool.
First of all i wanted to get list of the Worksheets.
The application is getting access violation in the row #10:
QString sheetname = sheet->Name();
I think the problem is that i incorrectly get the Excel::Worksheet object.
Does anybody know how to solve this problem?
The source code is shown below
Excel::Application* excel = new Excel::Application;
Excel::Workbooks* wbks = excel->Workbooks();
Excel::Workbook* wbk = wbks->Open(exchange->getFilename());
Excel::Sheets* sheets = wbk->Worksheets();
int count = sheets->Count();
for (int i=1; i<=count; i++)
{
Excel::Worksheet* sheet = (Excel::Worksheet*) sheets->Item(i);
sheetsList.append(sheetname);
}
wbk->Close();
excel->Quit();
Excel::Application* excel = new Excel::Application;
Excel::Workbooks* wbks = excel->Workbooks();
Excel::Workbook* wbk = wbks->Open(exchange->getFilename());
Excel::Sheets* sheets = wbk->Worksheets();
int count = sheets->Count();
QStringList sheetsList;
for (int i=1; i<=count; i++)
{
Excel::Worksheet* sheet = (Excel::Worksheet*) sheets->Item(i);
QString sheetname = sheet->Name();
sheetsList.append(sheetname);
}
wbk->Close();
excel->Quit();
To copy to clipboard, switch view to plain text mode
Thanks.
Bookmarks