All Posts Tagged Tag: ‘VB.Net And Excel’

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.

Read More

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. Amend as applicable. This is how you email will look like if you ran the …

Read More

Saving and Closing the Excel File (Save/Save As Method)


In continuation from here… There are two way to save the file: Save Save As When you do a simple “Save” then the original file is saved with the changes that you made. Whereas in the “Save As” a copy of the original file is saved. See the code snippets below. Save Save As When you do a Save As, …

Read More

Protecting/Unprotecting a Worksheet/Workbook

In continuation from here… If you want to protect the worksheet then use this code Let’s cover them one by one. Structure/Windows Protection Open Protection Covered in the section “Saving the Excel File (Save / Save As Method)” Write Protection Covered in the section “Saving the Excel File (Save / Save As Method)”

Read More

Printing Excel Sheet/Workbook

In continuation from here… To print an Excel Sheet use this code. However when you want to print the complete Excel File then here are two ways you can do it. If you want to simply print the file without checking the file then you can use this. And if you want to print the file from Excel then use …

Read More

Page Setup in Excel

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:

Read More
Page 1 of 41234»