1

In my *.mdb file I have a macro with an action that runs TransferText and gives me an Error Number of 2950 which according to Microsoft means that the document is not trusted, as far as I know it is trusted! It's located in the Trust Center Trusted Locations.

Action Failed, Macro Name: mcrImportFile, Condition: True, Action Name: TransferText, Arguments: 0, , IMPORT C:\Users\aleer\Desktop\GLEXPORT 001 12-13.txt, ,

Is there an explanation point next to the Action causing this in the macro whose tooltip reads This action will not be allowed if the database is not Trusted.

enter image description here

I already tried running a compact and repair on it, what could be causing this?

wattostudios
  • 8,666
  • 13
  • 43
  • 57
leeand00
  • 25,510
  • 39
  • 140
  • 297
  • I wouldn't trust the error code the macros give. It is hardly ever right. Any reason causing the macro to fail will return that code: invalid path to the file, invalid field names or field count, anything. – parakmiakos Jan 24 '14 at 10:53

3 Answers3

1

Method 1: Enable the database for the current session

When you use this method, Access 2007 enables the database until you close the database. To enable the database for the current session, follow these steps: On the Message Bar, click Options. In the Microsoft Office Security Options dialog box, click Enable this content, and then click OK. Note You must repeat these steps every time that you open the database.

Check here: https://support.microsoft.com/en-us/kb/931407

Rahul Patil
  • 159
  • 5
0

The problem can be as simple as not having first established an ODBC connection. I was getting this macro error (2950), and I ended up reading all the support threads, getting nowhere.

Then it struck me to install our ERP client first --which is the front-end for the database I was trying to access ...with Access.

Doing this established an ODBC configuration, so now when I opened my Access file, an ODBC prompt opened up before I even got to any of the functions that were triggering the error. In hindsight, I could have passed on installing the ERP client, and just went to the ODBC settings in Windows, and pointed a connection to the SQL table.

0

In my case there was a naming conflict. The macro in turn called a VBA function, and I had inadvertently named the function with the same name as the module it was in. They were both named "RobertsReport". Once I changed the name, everything worked as expected.

Tip: As troubleshooting steps, try running the macro solo by double-clicking on it. If you can, copy only the line that generates the error to a new macro to test it by itself, and of course include any preceding commands it may need to run properly. Once I did this it greatly narrowed down the problem until the lightbulb came on over my head.

spinjector
  • 3,121
  • 3
  • 26
  • 56