BHoM / Excel_UI

GNU Lesser General Public License v3.0
5 stars 4 forks source link

BHoM command initiated by VBA code not working #343

Closed rfczapiewski closed 1 year ago

rfczapiewski commented 2 years ago

Description:

When I want to initiate BHoM formula with VBA macro, it is not working, it gives me #NAME? error in the cell, but when I add this formula by clicking in the BHoM tab it is working result is ExcelErrorNull. image

There is a workaround if I first add the formula by clicking (manual initialization of the BHoM formula) then after that, the macro initialization is working. But it is not enough for me because I am creating excel add-in which will create template sheets with BHoM formulas but the BHoM formulas initiated by VBA are not working.

Steps to reproduce:

  1. Close all excel files - the whole excel application (it is very important to reproduce this issue)
  2. Open the file in attachment (BHoM_Bug.xlsm) and click the button "BHOM RUN MACRO"

Expected behavior:

  1. This will give you in cell D7 #NAME? value but I would expect ExcelErrorNull.

Test file(s):

BHoM_Bug.zip

travispotterBH commented 1 year ago

Hello @rfczapiewski,

Please ensure that you fill out the required parameters when instantiating the Adapter. You will need a connection string like so: image image

Below is what you get if you do not fill out the required parameters. image

On the macro version: If you download the 6.0 Beta(https://bhom.xyz/) you'll find that some modifications have been made that enable VBA commands better.

For security reasons, I did not look at the file provided by you in the issue report. However, I did re-make my own and got the same results that one would get if you did not fill out the required parameters. Please ensure that you fill out the required parameters. 2022-12-21 15_33_02-Window