Hi There,
A really stupid question - I have added a User Form to a spreadsheet which I have saved in the spreadsheet and I have saved it on Microsoft Teams so other Users can access the same spreadsheet. The spreadsheet works for me, (the form loads and I can input as required) however another colleague who can now access the same spreadsheet has pointed out the form cannot be loaded for them.
I have the following code:
The error message is :
"Cannot run the macro "Tracker Log.xlsm'!Sheet1.Button1_Click' The macro may not be available in this workbook or all macros may be disabled.
I'm not sure what to look for as I'm new to form creating.
Any pointers would be appreciated.
Thank you.
A really stupid question - I have added a User Form to a spreadsheet which I have saved in the spreadsheet and I have saved it on Microsoft Teams so other Users can access the same spreadsheet. The spreadsheet works for me, (the form loads and I can input as required) however another colleague who can now access the same spreadsheet has pointed out the form cannot be loaded for them.
I have the following code:
VBA Code:
Sub Button1_Click()
frmED.Show
End Sub
VBA Code:
Option Explicit
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
'find first empty row in database
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
With ws
' .Unprotect Password:="password"
.Cells(iRow, 1).Value = Me.txtDAName.Value
.Cells(iRow, 2).Value = Me.txtL.Value
.Cells(iRow, 3).Value = Me.txtNewAmend.Value
.Cells(iRow, 4).Value = Me.txtFC.Value
.Cells(iRow, 5).Value = Me.txtOGL.Value
End With
'clear the data
Me.txtDAName.Value = ""
Me.txtL.Value = ""
Me.txtNewAmend.Value = ""
Me.txtFC.Value = ""
Me.txtOGL.Value = ""
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub CmdClear_Click()
Unload Me
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the Close Form Button!"
End If
End Sub
Private Sub UserForm_Initialize()
' Initialize frm
' (This runs everytime the form is opened)
' frm is the form name
'
' Reset the size
With frmED
' Set the form size
Height = 369
Width = 392
End With
End Sub
The error message is :
"Cannot run the macro "Tracker Log.xlsm'!Sheet1.Button1_Click' The macro may not be available in this workbook or all macros may be disabled.
I'm not sure what to look for as I'm new to form creating.
Any pointers would be appreciated.
Thank you.
Last edited by a moderator: