How to Attach Module with Excel

[Closed]
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
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

1 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
802
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.