Forum Discussion

MB_47's avatar
MB_47
Copper Contributor
Jan 26, 2024

Excel VBA under MSoffice 365

Have made numerous spreadsheets with technical calculations on older versions of Excel;

Everytime excel migrates, I experience problems.

Right now, under MS Office 365, Win11, 64 bit, I cannot get a new function to work, very simple check case:

Public Function test2(n)
test2 = n
End Function

Settings:  VBA tools/references used: 

In the worksheet under file/options/trust centre settings I select: "trust VBA macro's"

same, under file /options/add-ins I have "solver addin" and "analysis toolpak".

 

error returned is #name,  "compile VBA project" does not give errors.

I must be doing something basic wrong, but what?

5 Replies

  • MB_47 

    Do you have a module also named Test2 in the workbook in the Visual Basic editor? That would confuse Excel.

    If so, give the module another name.

    • MB_47's avatar
      MB_47
      Copper Contributor
      Hans, txs for fast reply:
      no, I only have added module 1 and module 2
      • MB_47 

        Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

Resources