EPM Error "Object reference set to an instance of object" when saving data
I am having an error whose behavior is not consistent. I get a pop-up stating "Object reference set to an instance of object" when trying to save data. Now the problem is that error is not appearing every time but at random. I have checked on different machines for different users and the behavior is random.
Could you please help?
Gajendra Moond replied
Here is my understanding.
You have macro in your input form to save data which is like this:
Sheets(Your Sheet).Unprotect Password:="your password"
EPM API to save data
Sheets(Your Sheet).Protect Password:="your password"
It will work when online. However, once you take file offline and connect to system to submit changes made offline, you will get that error.
Even though you have unprotect and protect in your macro, you should supply the same password under sheet options --> Protection tab.
Once EPM has the password, it will unlock the sheet and save the data. For some reason, it reads password from sheet options even though you are supplying from the macro when connecting an offline form.