I am currently using Power BI Desktop without the publishing service. Basically just sharing pbix files. I would like to pull the M code out my pbix file so it is one less thing the end user can change.
I basically cut and paste the current file's M code and put in a txt file on my desktop alongside (eventually will be in a protected file share) with pbix file.
I then put that text file on my c:\.
I get an error when attempting to apply & close the query editor with the pbix file. The error as best I can tell is generic and not defined anywhere.
You should be able to copy the M code (right click your highlighted queries in the query editor and select Copy) and paste to a text file. Not sure why that would be causing an error when you try to close the query editor.