I have user form 'CemeaFinallist' in which there are checkbox and button. I want to use checkbox Name's value as a Variable=CNN in 'Normal.newmacros.minipro'
Following is userform button script
Private Sub Shift_Click()
CemeaFinallist.Hide
Dim ctl As Control
Dim j As Long
For Each ctl In Me.Controls
If TypeOf ctl Is MSForms.CheckBox Then
If Me.Controls(ctl.Name).Value = True Then
If ctl.Caption = "Select All" Then
Else
Application.Run MacroName:="Normal.NewMacros.minipro"
End If
End If
End If
Next
Application.ScreenUpdating = True
End Sub
following is Normal.NewMacros macro
Sub MiniPRO()
Application.ScreenUpdating = False
Dim path As String
Dim CNN As String
Dim ex As String
Dim News As String
Dim SD As String
path = "C:\Documents and Settings\Administrator\Desktop\EMEA CEEMEA\EMEA FOR DAILY USE\"
CNN = ctl.Name 'at this stage Run Time Error '424' Object required'
ex = ".DOCX"
Documents.Open FileName:=path & CNN & ex