cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Templates containing Macros

sourojit_pal
Participant

Hi,

Depending on a requirement from client, I had created a "button" in my Planning View Template and had assigned a macro to it. However, initially the macro woks perfectly but problem arises when I am trying to re-open my template after adding it to the favorites.

My template is reopening but the button is not working.

On clicking the button, following error is generated:

Please suggest if there is a way to save Macro enabled templates in my favorites.

Regards,

Sourojit

Accepted Solutions (1)

Accepted Solutions (1)

sourojit_pal
Participant

Hi,

Is there any specific way to use Macros in Excel?

Is this possible??

Regards,

Sourojit

Alecsandra
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sourojit,

Yes, you can use them attached to the planning view. The error seems linked with the excel settings you have, not with IBP add-on.

Please check:

Microsoft Office Button -> Excel Options -> Trust Center -> Trust Center Settings -> Macro Settings -> Select -> Trust access to the VBA project object model -> If not checked, please check, save, close and re-open excel.

Regards

Alecsandra

sourojit_pal
Participant
0 Kudos

Hi Alecsandra,

I have done as you said (shown in the screenshot below) but the problem still persists.

I am not able to share/save macro enabled templates in favorites.

Could you please advice me what else can create this issue?

Regards,

Sourojit

Alecsandra
Product and Topic Expert
Product and Topic Expert
0 Kudos

- Do you have any security warning that indicates that macros are disabled? This warning usually come on top of the workbook on a yellow / orange background with the option to enable content.

- Is the macro assigned to the excel workbook you tried to save?

- Could you also try and save as the favorite as macro enabled workbook (xlsm) before updating it?

sourojit_pal
Participant
0 Kudos

Hi Alecsandra,

Thanks, the macros are working when i save my template as Macro enabled first and then attach to favorite.

My observations on the possibilities shared by you are as follows:

- Do you have any security warning that indicates that macros are disabled? This warning usually come on top of the workbook on a yellow / orange background with the option to enable content.

Ans - I am not getting any security warning on opening the Template from Favorite

- Is the macro assigned to the excel workbook you tried to save?

Ans - I did not get this question. However, when I am assigning the macro on the button, "All active Workbook" is selected

- Could you also try and save as the favorite as macro enabled workbook (xlsm) before updating it?

Ans - After saving the workbook as macro enabled Workbook, if I add/update the favorite, the macros are working.

But, will this be possible for other users to use the Macro if I share it?

Regards,

Sourojit

Alecsandra
Product and Topic Expert
Product and Topic Expert

Hi Surojit,

You cannot store macros in xlsx files, hence you need a macro enabled file format. After you edited the button assigned macro, before updating it as a favorite, just try to save it locally with xlsx format: you will get a pop up indicating you that VB project cannot be saved in macro free workbook.

And yes, users should be able to access it, unless they have "Disable all macros w/o notification" setting.

However, this is excel related and I would advise you to check with someone with a better expertise in this area...

Cheers

Alecsandra

Answers (3)

Answers (3)

pradeepmolugu
Explorer
0 Kudos

Hi Pal,

Please check your macro ''VBA test.xlsx'!Button8_Click'.

Which is created and not in use try to delete the Macro which is in issue or try to enable the click option for the Button8_Click with proper selections.

issue is with Button not in use or incorrect Macro creation.

Regards,

Pradeep

sourojit_pal
Participant

Hi Pradeep,

The macros are defined correctly, and is executing well but we are facing issues when saving the them in favorites.

Regards,

Sourojit

sourojit_pal
Participant
0 Kudos

Hi Ankur,

I did not get your question.

Let me tell you what was done. After View was created from New View - From the Developer's Tab a button was created and the VBA code was written on it.

After saving this view to favourite when I am trying to reopen it, I am getting the error stated above.

Need some help in this regard.

Regards,

Sourojit

sourojit_pal
Participant
0 Kudos

Hi Experts,

Any updates on this?

Regards,

Sourojit

Former Member
0 Kudos

Hi Sourojit

Is it Excel Macro or VBA Macro? If it is Excel you may face this issue. As far as I know it should be VBA Macro.

Regards

Ankur