I'm attempting to complete a project and am still quite new to coding. When I'm finished, I want the Excel file to be a part of the software so that you could theoretically take the project files wherever you go. I need to open an Excel file that I created as a template to make copies. I want it to be able to be utilised even if the local computer does not have the file because it is writing data to a file (rather than reading and pulling data) (I.E. it should be in files with the application).
I haven't put much effort into attempting to make it work thus far because I've been busy. Although I now have the Excel workbook opening based on file location, this is not the end result I am hoping for. I have the project file on a flash drive because I am working on this across many computers, however if I work on it on a different system, the flash drive's root directory name is the same, thus it won't function. Can I turn it into an item or something in Visual Studio so it can be opened and modified without requiring a different file location than the project directory?
//open workbook.
oWB = (Excel._Workbook)(oXL.Workbooks.Open(@"[workbook file location here]"));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;