Is there a way that I can create this in vb.net for excel??

page 1 of 2

Title
Name | Address
.
.
.
.
Signature

page 2 of 2
Title
Name|Address
(continuation of page1)
.
.
.
Signature

Are you trying to create a new sheet in excel, or edit one that is current? If all pages are going to have Title, Name|Address, etc... then it may be easier to create a template and just fill it in.

I have some code that opens existing sheets and edits them. Not sure if they would help. I would have to dig for them. Let me know.

I remember doing something similar. If you are using VS or VB to build a solution then you would need to use one project template provided by visual studio or visual basic which helps to create application level add-ins. You can even build a function to extend and customize excel features.
If you are looking for a simpler way then you would need to use VBA language and build a macro in excel. If you have some knowledge in VBA then building a macro would be much easier.

You can create the same by just using an Excel file as a template.
Create an Excel file, in page setup set Header "Page 1 of ?", custom footer with "Signature", and for rows to repeat at top (can be found at sheet tab) select the 1st 2 rows.
The catch is that the continuation from page 1 won't show up automatically. You can use a custom header, with different first page and add this text in the header of every page other than the 1st.
If this works for you, save it, have your program open it populate it with data and save it with a different name. It's a lot easier this way.

Thanks for the reply.
I would like to know how to encode it using vb.net..

So you want a vb program that will create a new excel file with 2 pages and the data shown in your original post?
Do you plan on having data inserted on that excel file other than the header and footer from this program?

I get an error while Inserting record in Excel 2007 from VB.NET.
The error is ISAM Installable is missing.
What should I do ??
Please Reply.

@sanketberde - That should be a new post. As far as the error, try putting the exact message into Google. Sounds like you might just be missing a library or something.

@jaejoong - please be more specific about what you want to do.

This will allow you to access an Excel sheet. Maybe from here, you can figure out your layout and create functions accordingly.

Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel

Public Class excelEdit

   Dim trFile As New Excel.Application
   Dim trSheet As New Excel.Worksheet

   Public myExcelEditSub
     Dim myExcelFile As String = "c:\test.xls"
     trFile.Workbooks.Open(myExcelFile)
     trSheet = trFile.Workbooks(1).Sheets(1)
     'pull data from the sheet
     Dim strTest1 As String = trSheet.Range("D4").Value2().ToString
     'put data into the sheet
     trSheet.Range("D4").Value2() = "Hello World"
 
     'place information with a loop
     For x = 1 to 100
          trSheet.Range("A" & x).Value2() = x.ToString
     Next
   End Sub
End Class

Hopefully you can figure out more from here. I had used google to get me through this, and some more difficult problems. For what it seems you want to do though, this should work. Maybe create a couple of functions that insert the same header, and the same footer every time. Good Luck!!

Edited 5 Years Ago by bklynman01: Forgot some code...

I want to create this..

page 1 of 1
Jaejoong
Sample database
Name | Address
.
.
.

page1 of 2
Jaejoong
Sample database
Name | Address
(continuation of page1)

Thanks..

Comments
don't expect spoon feeding of code here.

Sorry dude, I'm not here to do your project for you. What I gave you will put data into, pull data from, and loop through data in Excel sheets. Its up to you to make it do exactly what you want.

Good luck.

This article has been dead for over six months. Start a new discussion instead.