How to Attach Module with Excel

Closed
Soail_3236 - Apr 16, 2010 at 03:37 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Apr 16, 2010 at 06:10 AM
How to attache Conversion Module in all New or Old Excel worksheets,
or when we are open the Excel worksheet then automatically activate this module in excel worksheet.

Sohail Khan
Karachi, Pakistan
Related:

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Apr 16, 2010 at 06:10 AM
I think you cannot activate a"module" ony activate one or more macros in the module
if you want to activate a module when you open the workbook

open vb editor (alt+F11)
hit control+R
on the left side the project window opens
go to your file whose name is there
in the list of projects under your file there is a term "thisworkbook"
right click this term and click view code
right hand side blank window opens
in this window there are two small windows on left and right
on the left side click that small arrow and choose "workbook"

automatically these statements will appear
Private Sub Workbook_Open() 
<here type the name of the macro> 
End Sub 

the macro need not be in this window but should be available in the module of that particular file.

so when you open the file automatically that macro will run.
0