My Blog

Download Embedded Pdf File In Excel

This question has been asked so many times but I have not seen a single working answer anywhere. This code works and is not dependant on the unreliable .InvokeVerb or the .Verb Verb:=xlPrimary method. Note: This will only work for pdf files. If there is a mix of...

Mailing the Excel file using Outlook

In continuation from here... Before you mail a file from Outlook, click on the menu Project | Add Reference. You will be presented with a Add Reference dialog box. Navigate to the COM Tab and select the Microsoft Outlook Object Library. Once done simply use this code....

Close Excel and Clean Up

In continuation from here... It is very important to close the objects after you are done with your coding. This ensures that all objects are released properly and nothing remains in the memory. See this code. Imports Excel =...

Printing Excel Sheet/Workbook

In continuation from here... To print an Excel Sheet use this code. Imports Excel = Microsoft.Office.Interop.Excel Public Class Form1 '~~> Define your Excel Objects Dim xlApp As New Excel.Application Dim xlWorkBook As Excel.Workbook Dim...

Page Setup

In continuation from here... Once you have the data all set in your worksheet, you might want to tweak a few settings in the page setup before the document can be printed. Here is the code: Imports Excel = Microsoft.Office.Interop.Excel...

Call Excel Macros

Let’s say we have the following Macros in Excel Sub RunMe() MsgBox "Called from VB.net Client", vbInformation, "Demo to run Excel macros from VB.net" End Sub Sub ShowMsg(msg As String, title As String) MsgBox msg, vbInformation, title End...