QAxObject and Excel
-
I have not work with Some Advanced level.
So I can't explain much more for it.but you can use this concept for read simple excel file and fatch the data from your excel sheet table.
And I Will Start the work on Excel Pivot table and other Advanced concepts.
Then i will drop the solution.wrote on 11 Feb 2021, 08:25 last edited by JonB 2 Nov 2021, 08:25@Ketan__Patel__0011
Hi Ketan.
No need for you to actually find solutions to what I wrote, they are just examples of what a user might want. Your suggestion of using SQL/ODBC instead of ActiveX is interesting. All I was saying is that if the OP wishes to go down that route they might use https://docs.microsoft.com/en-us/sql/odbc/microsoft/microsoft-excel-driver-programming-considerations as a starting point for documentation. That was all. -
@Ketan__Patel__0011
Hi Ketan.
No need for you to actually find solutions to what I wrote, they are just examples of what a user might want. Your suggestion of using SQL/ODBC instead of ActiveX is interesting. All I was saying is that if the OP wishes to go down that route they might use https://docs.microsoft.com/en-us/sql/odbc/microsoft/microsoft-excel-driver-programming-considerations as a starting point for documentation. That was all.wrote on 11 Feb 2021, 09:24 last edited by Ketan__Patel__0011 2 Nov 2021, 09:26Thank you for your complement
I Didn't get the any message from User(newbieQTDev ) so he Actually want Solution for Excel file Reading using ActiveX Then i Will Drop the solution for it.
I have both way solution for it But
SQL/ODBC
Nice And easy way for Excel file reading.And you are Agree with my Concept then Mark My Post As The Correct Answer.
-
Thank you for your complement
I Didn't get the any message from User(newbieQTDev ) so he Actually want Solution for Excel file Reading using ActiveX Then i Will Drop the solution for it.
I have both way solution for it But
SQL/ODBC
Nice And easy way for Excel file reading.And you are Agree with my Concept then Mark My Post As The Correct Answer.
wrote on 11 Feb 2021, 09:27 last edited by@Ketan__Patel__0011 said in QAxObject and Excel:
Actually want Solution for Excel file Reading using ActiveX Then i Will Drop the solution for it
Even if he does want only ActiveX, do not drop your SQL/ODBC solution here! It is a very useful alternative way of going about things, depending on what is wanted. Even if it is not right for this user, it is useful to read for others coming to this topic :)
-
@Ketan__Patel__0011 said in QAxObject and Excel:
Actually want Solution for Excel file Reading using ActiveX Then i Will Drop the solution for it
Even if he does want only ActiveX, do not drop your SQL/ODBC solution here! It is a very useful alternative way of going about things, depending on what is wanted. Even if it is not right for this user, it is useful to read for others coming to this topic :)
wrote on 11 Feb 2021, 09:29 last edited bySo Should I Delete My Post ?
-
So Should I Delete My Post ?
wrote on 11 Feb 2021, 09:40 last edited by JonB 2 Nov 2021, 09:41@Ketan__Patel__0011
Noooo!!! Not at all, I am saying your post is very useful. Maybe not to this OP, but potentially anyway to others. It is a good post :) -
So Should I Delete My Post ?
wrote on 11 Feb 2021, 09:41 last edited byhi
@Ketan__Patel__0011 said in QAxObject and Excel:So Should I Delete My Post ?
No, don't delete, i belive the OP is able to chose the right solution for what he needs
-
hi
@Ketan__Patel__0011 said in QAxObject and Excel:So Should I Delete My Post ?
No, don't delete, i belive the OP is able to chose the right solution for what he needs
wrote on 11 Feb 2021, 09:52 last edited by@LeLev
Okay i will Restore The Post
Sorry To Say But What Is Meaning Of
@LeLev said in QAxObject and Excel:
OP
? -
@LeLev
Okay i will Restore The Post
Sorry To Say But What Is Meaning Of
@LeLev said in QAxObject and Excel:
OP
?wrote on 11 Feb 2021, 09:53 last edited by JonB 2 Nov 2021, 09:54@Ketan__Patel__0011
I didn't see you had actually deleted your useful post! Yes, please do restore it!OP == "Original Poster", the person who starts a thread.
-
@LeLev
Okay i will Restore The Post
Sorry To Say But What Is Meaning Of
@LeLev said in QAxObject and Excel:
OP
?wrote on 11 Feb 2021, 09:54 last edited by@Ketan__Patel__0011 the person who created this thread, (Original Poster )
-
@Ketan__Patel__0011 the person who created this thread, (Original Poster )
wrote on 11 Feb 2021, 09:55 last edited by@LeLev
Okay i got it Thank You
-
@Ketan__Patel__0011
I didn't see you had actually deleted your useful post! Yes, please do restore it!OP == "Original Poster", the person who starts a thread.
wrote on 11 Feb 2021, 11:34 last edited byI Restored it
-
If you want to read any excel file then use
QSqlDatabase
For Itmy personal experience saying that
QAxObject
take Lot's of time for read any kind of Excel file
AndQAxObject
Very complicated Conceptyou can see my code for Read Any Kind Of Excel File
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", "xlsx_connection"); db.setDatabaseName("DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + QString(FilePath) + ""); if(db.open()) qDebug() << "Excel Is Connected"; else qDebug() << "Excel Is Not Connected"; QSqlQuery query(db); query.prepare("SELECT * FROM [" + QString("Sheet1") + "$]"); // Select range, place A1:B5 after $ if(query.exec()) { while (query.next()) { ///// Your Code } }
for this You must have to Install Mysql Driver For Excel
wrote on 8 Oct 2021, 14:30 last edited by@Ketan__Patel__0011 I agree with you. AxObject is very slow especially in Save Data.
-
@Ketan__Patel__0011 I agree with you. AxObject is very slow especially in Save Data.
wrote on 8 Oct 2021, 16:04 last edited byHappy To Help
-
wrote on 18 Nov 2021, 13:00 last edited by
Is it possible to get the cell's address using SQL/ODBC? I can get the column easily from
QSqlQuery::value
but how to obtain the row's number?
-
Is it possible to get the cell's address using SQL/ODBC? I can get the column easily from
QSqlQuery::value
but how to obtain the row's number?
-
@Koru I don't follow, could you give an example of what query you issue, how you get a column number and what you want to get for a row number?
wrote on 18 Nov 2021, 16:47 last edited by@JonB, the query is actually irrelevant, I just need to get the cell's address. I have an application that validates columns and lists cells that have wrong values. The validation result is the address and a failure message so the user knows exactly where the error occurs and what has to be fixed directly in a checked file.
SQL/ODBC queries compare columns faster than QAxObjects, but results lack addresses. The addresses don't have to be in an Excel manner like A12 etc., it can be a row/column number from the sheet.