ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Call VBA-Subs From Old XLM-Macros (https://www.excelbanter.com/excel-programming/292917-call-vba-subs-old-xlm-macros.html)

hglamy[_3_]

Call VBA-Subs From Old XLM-Macros
 
Hello there,

how can I refer to vba-code from an xlm-macrosheet ?

Thank you in advance,

Kind regards,

H.G. Lamy



Walt Weber

Call VBA-Subs From Old XLM-Macros
 
Hi,

Try the following. I've migrated some old systems with
similar code.

In the macro code on the Macro Sheet:
=RUN("FileName.XLM!ProtectSh",FALSE)
or (Both .xlm and .xls file extensions work)
=RUN("FileName.XLS!ProtectSh",FALSE)

where FileName is the name of the file with the VBA code

The 4.0 macro and VBA code can be in the same file, but
need not be.


The VBA code in the file with the called routine:
'*** PROTECT THE ACTIVE SHEET - NO PW ***
Sub ProtectSh()
ActiveSheet.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Best Regards,
Walt
-----Original Message-----
Hello there,

how can I refer to vba-code from an xlm-macrosheet ?

Thank you in advance,

Kind regards,

H.G. Lamy


.


hglamy[_3_]

Call VBA-Subs From Old XLM-Macros
 
Thank you Walt !

Regards,

H.G. Lamy

"Walt Weber" schrieb im Newsbeitrag
...
Hi,

Try the following. I've migrated some old systems with
similar code.

In the macro code on the Macro Sheet:
=RUN("FileName.XLM!ProtectSh",FALSE)
or (Both .xlm and .xls file extensions work)
=RUN("FileName.XLS!ProtectSh",FALSE)

where FileName is the name of the file with the VBA code

The 4.0 macro and VBA code can be in the same file, but
need not be.


The VBA code in the file with the called routine:
'*** PROTECT THE ACTIVE SHEET - NO PW ***
Sub ProtectSh()
ActiveSheet.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Best Regards,
Walt
-----Original Message-----
Hello there,

how can I refer to vba-code from an xlm-macrosheet ?

Thank you in advance,

Kind regards,

H.G. Lamy


.





All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com