How to include a formatted xls file, while creating a Setup wizard project in VS2010

Posted on 2012-09-05
Last Modified: 2012-09-06
I have windows desktop application which has several forms, crystal reports etc.
and 1 formatted xls file named "invoice.xls"

Below are the steps I followed to create a Setup project in VS2010 for VB.NET Windows application.

1. In the windows XYZ project. Changed mode to release and Build the application.
2. Created new project --> other projects --> Setup and deployment --> visual studio installer and choosed option "Setup Wizard"
3. Choosed setup for Windows application
4. Added all files under Release folder of XYZ project.
5. Then all stuffs like giving pre-requities,  setting up desktop folder, program menu. was done.
6. Then I have build the application in debug mode.
7. Changed from Debug to Release and build the application.

Took all files in release folder as package setup.
there were setup.exe and msi files and other pre-requities.

After installing ....all my crystal reports are working fine .....Even datagrid and export to excel is also working fine.

But there is one report after click of the button it should open with the formatted invoice.xls file....the xls file opens with a grey data ....and no files is saved to particular path.......

Also I tried by adding this invoice xls file in step while creating the project....still its not working.....

The inovice.xls works fine if I run (f5) the project XYZ .....

Please help me work to make this invoice.xls work in creating the setup project.....
Question by:anbu210

    Author Comment

    Just FYI....

    I used  below code to point to the xls file in my project

    fso.CopyFile(Replace(My.Application.Info.DirectoryPath, "\bin\Debug", "") & "\Invoice.xls", strName)

    Do I have to change this way of pointing the xls file....

    Remember this works good in debuggging mode and output is perfect....however only if a create a setup project it doesn't work...

    Accepted Solution

    Finally I solved myself.....

    While building the project XYZ in release mode I found that invoice.xls file was included in the project. I clicked "Show all files" and Excluded from the project and then build the application in release mode.

    and in the setup 4 mentioned above.....I added the files from release folder of XYZ and also added the xls file.....Everything is working as expected now.

    Author Closing Comment

    I solved myself....It worked

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Normally a window is moved by clicking on the caption bar and dragging. You may want your user to be able to move borderless forms or move a form by clicking anywhere in the form without the limitation to the caption bar. There are many ways to do i…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now