I think you may have to pass the before and after parameters into the copy method. otherwise, the sheet will be copied to a new workbook.
I think you may have to pass the before and after parameters into the copy method. otherwise, the sheet will be copied to a new workbook.
hi and thanks to spend some time on my problem.
I had already think about using Before and after parameter but don't success to do anything
HOw can I pass this parameter?
I had try :
worksheet->dynamicCall("Copy (const QVariant&)","After:=Sheets(3)");
result :NOTHING COPY
or
worksheet->dynamicCall("Copy After:=Sheets(3)");
result :NOTHING COPY
Any idea?
Last edited by gerardpuducul; 19th November 2012 at 13:54.
the docs are quite clear on how to use arguments with dynamicCall
http://doc.qt.io/qt-4.8/qaxbase.html
QVariant one;
QVariant two;
worksheet->dynamicCall("Copy", one, two);
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
thanks for your answer!
My source code are in post 1. I don't understood why you don't have seen it.
So I know how to pass arg to dynamic call but i don't success to apply them to have working copy in the same worksheet in excel. ( or maybe argument are wrong)
But anyway i had try your tipo :
and replace line 36 of my sources code in post 1
by
Qt Code:
worksheet->dynamicCall("Copy", one, two);To copy to clipboard, switch view to plain text mode
and nothing is copy
Any suggestion?
It looks like you don't know how Copy works.
here is the help
http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx
Looks like this is no longer Qt programming question...
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Hi,
Thanks a lot yours link. It help me to find the solution. I need to pass the object worksheet for before or after parameter;
so instead of
Qt Code:
sheet->dynamicCall("Copy");To copy to clipboard, switch view to plain text mode
I do
Qt Code:
worksheet_copy_after = sheets->querySubObject("Item( int )", 5 ); worksheet_to_copy->dynamicCall("Copy (const QVariant&)",param1);To copy to clipboard, switch view to plain text mode
and the copy occurs in the same worksheets!!!
Thanks
In fact I success to copy before but not After
according to : http://msdn.microsoft.com/en-US/libr...(v=vs.80).aspx
I try to pass en empty Qvaraint to the first parameter but nothing happen.
Qt Code:
worksheet_copy_after = sheets->querySubObject("Item( int )", 5 ); worksheet_to_copy->dynamicCall("Copy (const QVariant&, const QVariant&)",param1,param2);To copy to clipboard, switch view to plain text mode
How can I do?
Thanks
use a null QVariant, not a QVariant with a string="missing"
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
I had already try with NULL variant (and a lot of stupid test that i prefer to not post here)
but nothing is working
Qt Code:
worksheet_copy_after = sheets->querySubObject("Item( int )", 5 ); worksheet_to_copy->dynamicCall("Copy (const QVariant&, const QVariant&)",param1,param2);To copy to clipboard, switch view to plain text mode
any suggestion?
thanks
QVariant param1 = NULL;
does that even compile? I don't believe it is a null variant though - if it compiles it will be a QVariant of type string with string = "", or a QVariant of type int with value = 0, or something like that.
This is how you make a null variant:
QVariant param;
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Of course it compiles. I will not post something which not compile.
Qt Code:
worksheet_copy_after = sheets->querySubObject("Item( int )", 5 ); QVariant param1; worksheet_to_copy->dynamicCall("Copy (const QVariant&, const QVariant&)",param1,param2);To copy to clipboard, switch view to plain text mode
Doesn't work anymore!
only this idea, I don't know if it will work at all:
Qt Code:
call = call.arg(after); activeX->dynamicCall(call.toLatin1().constData());To copy to clipboard, switch view to plain text mode
I thought of that after reading http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx and http://qt-project.org/doc/qt-4.8/qax...ml#dynamicCall. The problem is how to deal with 'missing' correctly. If you can think of some way to access System.Type.Missing then that will probably help.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
NULL is:
therefore this:
stores an integer of value "0" in the variant.
Bookmarks