LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How i can remove a macro from an existing excel file?

When i use the excel remove module (Report Generation Toolkit) i have to put a reference of the macro.

 

Can everybody hepl me?

 

 

0 Kudos
Message 1 of 8
(3,655 Views)

Maybe I didn't understand your question..

 

Are you loading a macro then you want to remove it?  I am asking that because you are using the remove module.vi.

 

Are you trying to do what is shown in the image below?

 

 

Typically, you would have to import the module, run the macro and then remove module.

 

Is the macro being called using LabVIEW?  Or are you trying to remove an already existing macro that was created in Excel (outside LabVIEW)?

Message 2 of 8
(3,647 Views)
My problem is that the macro is in the excel file. I dont have to include it. So I didnt have a reference on the macro.
0 Kudos
Message 3 of 8
(3,638 Views)

You may need to use ActiveX instead..

 

0 Kudos
Message 4 of 8
(3,624 Views)
Can you it explain please. I never did that before.
0 Kudos
Message 5 of 8
(3,618 Views)

You may need to read some details from the Microsoft site to determine what ActiveX properties will do the trick.

 

I had a quick look in the ActiveX property & invoke nodes but did not see anything at first glance.

 

Here's how you work with ActiveX in LabVIEW.

 

On the block diagram, look in the functions palette for Connectivity and select ActiveX.

Inside it you'll find Automation Open.vi  Put it on the block diagram.  Right clickAutomation Refnum and select "Select ActiveX Class".

You then browse all the way down to Microsoft and look for Excel.  I tired the latest, which does not necessairily mean the correct class.

 

So on the Microsoft website, you should be able to find info on the correct class and property that you need to work with.

 

You will then need the appropriate invoke or property node that matches what you are looking for, as shown in the image below:

 

 

 

Hope it helps.

 

R

Message Edited by Ray.R on 03-02-2010 01:54 PM
Message 6 of 8
(3,616 Views)

I've made it this way. You have to choose the excel_workbook reference. Important is to check the macro security options in excel. I dont know the english words for the option. Index is the name of the module to remove.

Code.gif

Message 7 of 8
(3,597 Views)

Well done! And thanks for sharing.

 

🙂

Message Edited by Ray.R on 03-02-2010 04:50 PM
0 Kudos
Message 8 of 8
(3,588 Views)