Author Topic: Embed xlsx file template  (Read 700 times)

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Embed xlsx file template
« on: August 11, 2018, 12:28:54 AM »
I have a xlsx file that I am using as a template to write to using EPPlus. This works fine but I want to make the application portable so I would like to make the xlsx part of the solution and not have it available for the user to be able to alter. What is the best way to make it part if the project so that I dont have to add it to the host computer?  Also I may need to alter it later if the application changes so I would need to be able to exchange it for a newer version at times. Thank you.

bachphi

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Embed xlsx file template
« Reply #1 on: August 11, 2018, 10:22:09 AM »
You can try like this:

Dim filePath  = "c:\Program Files\top\level\secret\only\me\know\pikey.xlsx"
or
Dim filePath  = "\\myserver\myshare\top\level\secret\only\me\know\pikey.xlsx"
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Embed xlsx file template
« Reply #3 on: August 15, 2018, 04:00:14 PM »
Thanks guys.  I started with that method bachphi and transitioned to the method Godra posted.  However they both require a copy of the xlsx to be saved somewhere on the host PC.  I was hoping to add it as a resource similar to an image file so that it can be part of the compiled project.  Know of anyway to accomplish this?  Thanks.   

bachphi

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Embed xlsx file template
« Reply #4 on: August 16, 2018, 06:06:36 PM »
If the filepath is \\myserver then it would open from the server side , not the host PC
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================