Unable to set the LeftHeader property of the PageSetup class

I found this error when im trying to export report to excel. 

This message is for C/AL programmers:

The call to member LeftHeader failed. Microsoft Office Excel returned
the following message: Unable to set the LeftHeader property of the
PageSetup class

Do you have any default printer set?

Yes printer is set for the PC.

some time back I read a MS support case that this problem will arise when we dont have access to default Printer…

Problem sorted. Default printer was not recognized by the server. now its ok i gave the another working printer as a default printer

Thanks for sharing the solution