shimuno
08-26-2008, 06:26 AM
Hello
I have designed two macros allowing the user to paste and format excel tables (macro number one) and excel charts (macro number (two) in a word document. The user must copy the excel object and then use the macros.
I use the following code to paste an excel table :
Selection.PasteExcelTable False, False, False
And I use this to paste an excel chart :
Selection.PasteAndFormat (wdPasteDefault)
Here is my problem : the macro do not work if the user select an excel chart and try to paste it by using the macro designed for an excel table (likewise, he cannot select an excel table and paste it with the macro designed for an excel chart).
Could you please help me with this one ? Maybe, I could try to retrieve the type of object located in the clipboard, but I do not know the appropriate instructions.
Thank you very much for your help.
I have designed two macros allowing the user to paste and format excel tables (macro number one) and excel charts (macro number (two) in a word document. The user must copy the excel object and then use the macros.
I use the following code to paste an excel table :
Selection.PasteExcelTable False, False, False
And I use this to paste an excel chart :
Selection.PasteAndFormat (wdPasteDefault)
Here is my problem : the macro do not work if the user select an excel chart and try to paste it by using the macro designed for an excel table (likewise, he cannot select an excel table and paste it with the macro designed for an excel chart).
Could you please help me with this one ? Maybe, I could try to retrieve the type of object located in the clipboard, but I do not know the appropriate instructions.
Thank you very much for your help.