Freelance Project Requests Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net

Excel, vba: insert image into a cell of cache


This command adds a bitmap image to a special cell in Microsoft Excel in Excel

Excel.Sheet Paste Destination

'< Insert Image in Excel-Cell C3 >

mySheet.Paste Destination:=mySheet.Cells(3, 3)

'</ Insert Image in Excel-Cell C3 >




Code example

The following example inserts a bitmap image of a barcode from a Microsoft Access database directly into an Excel file via the clipboard buffer.

Option Compare Database

Option Explicit On


Private Sub btnStart_Click()

    '--------< btnStart_Click() >--------

    '--< Create Barcode Image >--

    '*Barcode39 Image into Clipboard


    Dim objBarcode As New axBarcode39.ComControl


    '--< Barcode anzeigen >--

    objBarcode.create_Barcode39_to_Clipboard tbxEncode.Value, 100

    '--</ Barcode anzeigen >--


    Set objBarcode = Nothing

    '--</ Create Barcode Image >--


    '----< Insert Clipboard Bitmap into Excel Cell >----


    '< create >

    Dim objExcel As Excel.Workbook

    Set objExcel = Workbooks.Add

    '</ create >

    Dim objSheet As Excel.Worksheet

    Set objSheet = objExcel.Worksheets(1)


    '-< insert >-

    '< Insert Image in Excel-Cell C3 >

    objSheet.Paste Destination:=objSheet.Cells(3, 3)

    '</ Insert Image in Excel-Cell C3 >

    '-</ insert >-


    '</ Abschluss >

    '*unbedingt schliessen...

    Dim sFilename As String

    sFilename = CurrentProject.Path & "\AE_Barcode2.xlsx"

    objExcel.SaveAs sFilename


    Set objExcel = Nothing

    '</ Abschluss >

    '----</ Insert Clipboard Bitmap into Excel Cell >----


    '--------</ btnStart_Click() >--------

End Sub



* The ActiveX Control Barcode39 is used to create the barcode

Errorcode 450 Using Email.Session.Accounts Email_From
Open and Read a Word File with Excel
Excel: REwrite RTF to HTML
Excel: Convert numbers, date and time to text
Excel: Convert letters to Ascii numbers around
Excel File Dialog for Selecting File-Paths to Worksheet
Excel Template: Automatically send an e-mail for a specific entry in Excel
Excel vba: recognize an input in cells
Excel, vba: insert image into a cell of cache
Excel: Formelfelder per Code kopieren


Contact for Jobs, Project Requests: