Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro avec paramètre

Bonjour,

Je souhaite pouvoir passer des paramètre à un macro.

Exemple :

sub export( val1, val2)

      'Ouvrir Excel     
      set XLApp = CreateObject("Excel.Application") ' Define Object
      XLApp.Visible = True 'Visible set as true
      set XLDoc = XLApp.Workbooks.Add 'Open new workbook                

      'récupération Sélection active 
      set VL1    = ActiveDocument.GetSheetObject(val1)
      'Copie du tableau dans la feuille Excel
      set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted
      VL1.CopyTableToClipboard true 'Copy data to Clipboard
      XLSheet.Paste XLSheet.Range("A1") 'Paste data into cell       

      'récupération tableau 
      set VL    = ActiveDocument.GetSheetObject(val2)
      'Copie du tableau dans la feuille Excel
      set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted     
      VL.CopyTableToClipboard true 'Copy data to Clipboard
      XLSheet.Paste XLSheet.Range("D1") 'Paste data into cell  

end sub   

    

Appel de cette macro à l'aide d'un bouton "Onglet" Action, "Action" Exécuter une macro, "Nom de la macro" export("Obj 1", "Obj 2")

Qu'elle est la bonne syntaxe?

Quelqu'un peut-il m'aider sur ce sujet.

D'avance merci

2 Replies
Not applicable
Author

Hi,

you cannot pass parameters while calling macro function as an button action, but there is some workaround: http://community.qlik.com/message/202084#202084

regards

Not applicable
Author

Hi,

Thanks for your answer, I'll try it.

Regards

De : Krunoslav Pap <qcwebmaster@qlik.com>

A : gillesremy <g.remy@groupauto.fr>

Date : 28/09/2012 15:02

Objet : - Re: Macro avec paramètre

QlikCommunity

Re: Macro avec paramètre

created by Krunoslav Pap in Development (QlikView Desktop) - View the full

discussion

Hi,

you cannot pass parameters while calling macro function as an button

action, but there is some workaround:

http://community.qlik.com/message/202084#202084

regards

Reply to this message by replying to this email -or- go to the message on

QlikCommunity

Start a new discussion in Development (QlikView Desktop) by email or at

QlikCommunity

© 1993-2011 QlikTech International AB Copyright & Trademarks | Privacy

| Terms of Use | Software EULA