Asked by duncanb7
at 2024-07-13 22:58:45
Point:250 Replies:16 POST_ID:828357USER_ID:11059
Topic:
Microsoft Access Database;Microsoft Excel Spreadsheet Software;Visual Basic Programming
I would like to ask several question
1) As we know we can create function and sub on Excel Sheet and
Excel module from popup VBA Excel editor by Alt-11 key. The question is
what is dfferent between the code we create on the sheet and module ?
2) When I call the module named Smain in other Exce VBAl file, I can't
call it, why ? What is syntax for that.
3) OR I need to include Smain of Chart.xls as the library in myexample.xls
Please advise
Duncan
'myexample.xls
Sub main()
Workbooks.Open Filename:= _
"d:chart.xls"
Call Workbooks("chart.xls").Module1.Smain
End Sub
---------------
'Chart.xls file
Option Explicit
Public sub Smain()
'Code
End Sub
1) As we know we can create function and sub on Excel Sheet and
Excel module from popup VBA Excel editor by Alt-11 key. The question is
what is dfferent between the code we create on the sheet and module ?
2) When I call the module named Smain in other Exce VBAl file, I can't
call it, why ? What is syntax for that.
3) OR I need to include Smain of Chart.xls as the library in myexample.xls
Please advise
Duncan
'myexample.xls
Sub main()
Workbooks.Open Filename:= _
"d:chart.xls"
Call Workbooks("chart.xls").Module1.Smain
End Sub
---------------
'Chart.xls file
Option Explicit
Public sub Smain()
'Code
End Sub