954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Dynamic File Path Support Question

Hey people, I've been coding in vb.net for a while but never had to publish anything (it didn't get covered during any of my classes) so here's my confusion:
Context:
My application uses an existing excel spreadsheet which it then modifies per user input, and saves the modified version to the user's MyDocs folder.
Issue:
During development that .xls file sat in my project folder, and was accessed w/o error. When I publish the app, how do I ensure that it still has access to the file?

What I think I need is a dynamic file path to the spreadsheet, so that during development I can access it while its in my project folder, and after deployment I can be sure that the app can still find it once it's installed into the Program Files folder.

Thanks for reading. Any Suggestions?

dsul
Newbie Poster
3 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

hello .. how about storing the file as an array of bytes in the application resources and then generate the file on start up if it doesn't already exist ?

If My.Computer.FileSystem.FileExists("file.xls") Then
            My.Computer.FileSystem.WriteAllBytes("file.xls", My.Resources.xlsfile, False)
        End If

project properties> resources> add resource> add existing file> browse the xls file and name the byte array resource to xlsfile for example.

ÜnLoCo
Light Poster
40 posts since Dec 2009
Reputation Points: 10
Solved Threads: 8
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: