web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

(0) ShareShare
ReportReport
Posted on by 480

Hi All,

I want to add new Price/discount agreement journal lines with Excel Add-In in AX 2012 R3 CU8.

Data is opened properly in Excel and if I press Publish button without adding any line everything is fine.

After adding a new record and filling it with data I get the following error:

"An error occurred. The data in the workbook and the behavior of any

add-ins may not be correct. Consider contacting your system

administrator about this problem.

 

Object reference not set to an instance of an object."

If an exported row is modified then changes are updated in AX successfully. The problem appears if a new record is added.

I tested it on three environments: AX 2012 R3 CU8 Demo VPC, clean AX 2012 R3 CU8 installation with Contoso data and clean AX 2012 R3 CU8 installation with some initial data. There are no customization of the system.

Attaching VS debugger to Client, Excel or AOS doesn't cause any exception catch.

Haves anybody face that issue?

Thanks,

Lukasz

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Hi Lukasz,

    Thank you very much, it works fine now!

    Igor.

  • Santosh Profile Picture
    766 on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Hi All,

    I know this is weird to resolved this issue. Even I am facings this, but somehow resolved up to certain stage. Did whatever is mention in this on going blog.

    Now I am able to upload Journals data. I have done following steps.

    1. Deployed the LedgerService in the AOT (AOT>Services>LedgerService)
    2. Deactivate and activate System Administration > Setup> SAIF > Inbound Port > LedgerService
    3. Created new excel template

    Note :  Try to use same file but it gave me the error so please do not use old excel template file which are giving the error.

    Hope you can get solution.

    Regards,

    Santosh

  • Community Member Profile Picture
    on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Hi,

    Not sure if this is resolved, I faced a similar problem.

    My connectivity settings under Dynamics tab >> Configure >> options was wrong. Please validate it.

    also try to disable and enable back the Dynamics AX excel-add in under com-add ins

  • Community Member Profile Picture
    on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Hi,

    I am afraid this is not completely true.

    Keep using Dynamic property Yes, SELECT * will be smaller in your SQL.

    Try Unselected and remove certain fields on some tables.

    However it is true that the SQL is too long (max 2000 char I think).

    Try to reduce it.

    Fredrik.

  • Community Member Profile Picture
    on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Hi,

    I think I know the answer to this one.

    The query generates an SQL-statement for the selection of the fields from the tables.

    When the SQL-statement gets too long it will be cut.

    This generates the error described with Object reference not set to an instance of an object.

    The SQL-line will simply be to long and needs to be reduced.

    What you can do is to switch the Dynamic property on the db-fields to No and delete the fields you don't need (for all tables).

    This should solve the problem.

    Good luck.

    Regards,

    /Fredrik.

  • lcwik Profile Picture
    480 on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Gents,

    Believe me, I tried everything: recompilation (with truncating XPPASSEMBLY table, deleteing files, etc.), AIF reinitialization and redeployment and those steps were done in different combinations but the result was always the same.

    Only rebuilding the Excel file helped in this case.

    Regards,

    Lukasz

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Hi Lukasz,

     I had faced similar issue in Excel add in for Budget Planning services and on receiving the error did the following steps to overcome it:

    1) Ensure you have a clean full CIL compile.

    2) Refresh the client configuration services element.

    3) Test again, should the issue still persist then consider rebuilding your excel template from scratch. Any potential metadata differences would get resolved with it.

    Regards

    Rahul

  • Kauto Profile Picture
    2,654 on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    A fully compiled CIL environment with no errors and an AOS restart should allow the excel upload to function correctly, providing the correct data is being input.

  • lcwik Profile Picture
    480 on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    Hi All,

    My colleague found a solution here:

    http://organicax.com/2015/04/29/create-new-spreadsheet-for-price-discount-journal-maintenance/

    It turned out that the Excel file under AOT/Resources node needs to be updated.

    Cheers,

    Lukasz

  • sshaheen Profile Picture
    127 on at
    RE: Excel add-in error : "Object reference not set to an instance of an object" while publishing new price/discount agreement journal lines

    I wasn't able to solve the problem, but I did code a workaround. I created a modification that will add new lines to the journal before opening it in Excel.

    Then the information can be entered into those pre-created new lines and will be sent back in as updates to the records.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
howalker Profile Picture

howalker 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans