View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Walt Weber Walt Weber is offline
external usenet poster
 
Posts: 14
Default 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


.