Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb.net+excel workbook 1

Status
Not open for further replies.

Horowitz

Programmer
Jan 29, 2005
30
GR
Hello, :) listen to what i'm trying to do:

In my application in VB.NET (2003) the user will fill in some textboxes and by clicking "OK" the data will be written to some cells in an Excel Sheet, and finally the excel sheet will be printed.

The question is:

How can i include the excel sheet in the .exe of the app?? In other words I don't want the excel sheet to be available.
 
Not complete code:
Code:
            Dim ExcelApplication AS New Excel.Application
            Dim ExcelWorkbook = ExcelApplication.Workbooks.Add

            ExcelWorkbook.Worksheets.Application.Cells(1, 1) = textBox1.Text
            ExcelWorkbook.PrintOut('Fill here)
It works for Excel 2000. In Excel 2003 it's different. I think you need to add a named worksheet.
Just wondering, why are you using excel for that? there are better ways to print.
 
Well, i should use excel to make a good inteface,leave some cells blank and using the vb app to fill in the cells and finally print the sheet. (i want to have boarders, font color-size-name, cell's backcolor..green. That is eazy with excel.) As i do this i need to "encrypt" the sheet in the exe file somehow

Do u suggest anything?
 
If you just want to use excel design, and you don't want the user to see the worksheet, I think it is a waste. Dealing with excel is not so simple, and your code may encounter compability problems with different versions of Office. I use Infragistics data grid and it has a built in function to print the grid with its design, but it cost money. If you search the internet, i'm sure you can find a simple way to print Microsoft data grid, which is a better solution than excel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top