Example Code

Using password-protected Excel templates for Report Generation

Code and Documents

Attachment

Introduction

If for any reason a user wants to use a password-protected Excel template for Report Generation the ability is not baked into the Report Generation Toolkit. In order to workaround this we need to step down through several subVI's and make password input available, implementing it with a Functional Global Variable.

Steps to Complete

1. Setup subVI to use password.

  a. Navigate through subVI's to Excel_Open_Workbook.

           NavigatingThroughSubVIs.png

  b. Import pswdGFV.vi and wire through Convert to Variant to both the password and writeResPassword.

   PswdGlobalFuncVarImplementation.png

   c. Save and close.

2. Implement pswdGFV.vi on main VI and set password ensuring to run this VI before the rest of the application.

  MainVIimplementation.png


Ben J.
National Instruments
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Jirav_Fadia
Member
Member
on

Jey.. it s really good.... Thnks for your invention.....

eleorka
Member
Member
on

Hey Ben,

can you send me VI's used in this report?

Thank you

eleor@hotmail.com

Ben_J1
NI Employee (retired)
on

Which ones? Most of them come with the Report Generation Toolkit and the ones that I edited are attached below the explanation.

Ben J.
National Instruments
Applications Engineer
valiyattil.26
Member
Member
on

Thank you sir for the code.....iam having one doubt..in PswdFGV.VI (which is added as subvi)  error line is not there coming out of it i..but in snapshot it's there....from where you have taken that...please help

Contributors