ERROR : The type or method CreateBook cannot be used for Extension development.
Facing above error while convert our extension from V1 to V2
The table "Excel Buffer" has methods that are not allowed for 'Extension' development such as 'CreateBook', 'OpenBook'. I have read the FAQ and I know that I can change my target to Internal, but if I want to create a real extension that can read and write Excel files, what options do I have? I'm assuming that the MSDyn365BC product will include the ability to import a budget from Excel and export a budget to Excel, so why can't we do the same in our own extensions? If there is a work-around for this, can you please provide some details on how an Extension could be written to import and Excel spreadsheet.
The problem with the CreateBook and OpenBook functions is, that they use files, which aren't allowed in BC extension development. The solution to this problem is to use streams instead of files. For OpenBook, we've implemented the alternative OpenBookStream, which you can use instead. The CreateBook alternative for now is CreateNewBook, but we still have some refactoring to do, as that function does use a tempfile in the background. That is work in progress. But you should be able to unblock yourself by using those two replacement functions. I hope that helps! If you have further questions, please let me know!
Thanks to everyone.
i am using streams to fulfill my requirement
Glad I could help :-) If you run into other problems, please reopen this issue or create new one.