How can I use a office 365 COM component on a computer without office 365 installed?
I have this system that imports data from SQL server to Excel, pretty straightforward actually. Maybe the only problem is I use loops to allocate which cells to put data on.
Why do I concluded that I need office 365 components?
First I used a computer with office 365 on it, I could import the data into the excel sheet.
Afterwards, I recompiled the same code on a machine without office 365, I can only get a few lines on my excel sheet. Interestingly though, the lines are consistent, only appearing on the 77th row but the data is imported the same way as the other rows.
I also tried a blank document to see if the formatting was at fault, but the import is still unsuccessful.
I tried to change the excel type too, from .xlsx into .xls but the result is the still unsuccessful.
I then recompiled the code on a computer without office 365, then installed office 365 in it, the code now works fine! After uninstalling the office 365 on the same computer, the code didn't worked anymore.
I tried to copy and paste the office 365 component which I think helps to upload succesfully (MSO.DLL), which is located at 
C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\OFFICE16. 
When using on a computer without office 365, the code doesn't work.
IF you want to know what kind of code I have during the import, I have this code:
                For e = 0 To dt.Columns.Count - 1 
                     objWorksheet.Cells(MyRow1, MyColumn) = dt.Rows(a).Item(e).ToString
                    MyColumn = MyColumn + 1
                Next
I am running out of ideas on how should I work through this, I am thankful for any suggestions that will be raised.