[Solved] ActiveQT, Cannot Open properly a protected xls or xlsx file
I'm developing an application which requires to open xls and xlsx files protected by opening and/or writing password.
I'm stuck since I cannot open files w/o showing the excel's pop-up password input messagebox.
Open Method References: http://msdn.microsoft.com/en-us/library/ff194819(v=office.14).aspx
@ QAxObject* workbook = workbooks->querySubObject("Open(const QString&,missing,missing,missing,const QString&,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing)",
Tries so far (not posting the real code):
1- Open(filename,null,password(5th arg),null)
In any of these cases i tried with:
Since I had no idea what was(is) going on, I tried also:
2a- Adding gradually missing in password argument-1 position until the 15th argument, ex:
Open(filename,missing,password) and so on
2b- Fixxed password on the fifth and tried to input random data in other arguments
3a- Open(const QString&, Password:password) //as written
3b- Open(const QString&, Password:"password") //as written
Solved This Way (even if I'm unsatisfied):
QAxObject * workbook =
workbooks->querySubObject("Open(QString, QVariant, QVariant, QVariant, QVariant, QVariant)", params);@
I solved this way because you can't skip optional parameters before the needed one, even if I thought that the =0 solution would work.