Insert Background Pictures in Excel 2007 from VB.NET

By: Issac Emailed: 1588 times Printed: 2041 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

This article will enable you to add a background picture in Excel 2007,this can be done by using SetBackgriundPicture method

Syntax : SetBackgroundPicture(ByVal Filename As String)
Filename : The filename of the picture.

Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
                ByVal e As System.EventArgs) Handles Button1.Click

        Dim xlApp As Excel.Application
        Dim xlWorkBook As Excel.Workbook
        Dim xlWorkSheet As Excel.Worksheet
        Dim misValue As Object = System.Reflection.Missing.Value

        xlApp = New Excel.ApplicationClass
        xlWorkBook = xlApp.Workbooks.Add(misValue)
        xlWorkSheet = xlWorkBook.Sheets("sheet1")

        'set back ground
        'replace your background picture to xl_pic.JPG




        MsgBox("Excel file created , you can find the file c:\")
    End Sub

    Private Sub releaseObject(ByVal obj As Object)
            obj = Nothing
        Catch ex As Exception
            obj = Nothing
        End Try
    End Sub
End Class

When you execute this program, you will get an Excel file (C:\vbexcel.xlsx) with insert background picture. Home | All Tutorials | Latest Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.

Bookmark and Share


Be the first one to add a comment

Your name (required):

Your email(required, will not be shown to the public):

Your sites URL (optional):

Your comments:

More Tutorials by Issac
Save/Write/Read image file from/to a database using Java program
How to modify the objects using java classes
Java program for Cloning
Java program for changeable wrapper class
A tutorial on Chat Server and Chat Client in
Chat Server in
Chat client in
How to open and read an XML file in
How to create an XML file in
XML and
How to create an XML file in VB.NET using Dataset
Multi Threaded Client Socket Programming in
Multi Threaded Server Socket Programming in
Multi threaded Socket Programming in
Client Socket Program sample in

More Tutorials in
Scope in
Unstructured Exception Handling in
Structured Exception Handling in
Creating Sub Procedures in
Creating Functions in
Passing a Variable Number of Arguments to Procedures in
Specifying Optional Arguments with default values in Procedures in
Preserving a Variable's Values between Procedure Calls in
Procedure Delegates in
Properties in
Understanding Scope in
Using Resume Next and Resume Line in
Using On Error GoTo 0 in
Getting an Exception's Number and Description in
Raising an Exception Intentionally in

More Latest News
Most Viewed Articles (in )
Your first VB.NET Crystal Reports - A step by step guide
How to export from DataGridView to excel using
Operators in
Sub Procedures and Functions in
How To Connect To A MySql Database in
Update cell data in an Excel file using OLEDB in
Multi threaded Socket Programming in
Visual Basic Statements
String.Contains (), compare, clone in
To read the entire worksheet in an Excel workbook through Code
How to export from database to excel using
Sending email using CDOSYS in
Server Socket Program sample in
Creating Sub Procedures in
Throwing an Exception in
Most Emailed Articles (in
How to export from DataGridView to excel using
“Using If with And” and Comparing two integers using If
While Loop in
How to find IP Address of Host using .net code
Send SMS using VB code
The Select Case statement in
The For Loop in
Operators in
Do Loop in
Sub Procedures and Functions in
Export Chart from Excel 2007 as Picture file in VB.NET 2005
Using Excel 2007 Chart Picture Box
Using Excel 2007 DataBar in
Multi Threaded Server Socket Programming in
Using Finally in