J
JayDe
Hi
I am trying to set the workbookname in a sub procedure but it is not working.
Her are the part from my code that is not working:
Private Sub Start_Click()
Dim MalWb as workbook
Dim MalTxt as String
Set MalWb = Workbooks(ActiveWorkbook.Name)
MalTxt = ActiveWorkbook.Name
' Here I have som code to put data into MalWb
Call ReskontroArk("Kunder", MalTxt)
End Sub
Private Sub ReskontroArk(ReskontroType, MalTxt As Variant)
Dim MalWb As Workbook
Set MalWb = Workbooks(MalTxt) ' run time error 1004. Canot find file
End Sub
Can someone see what I have done wrong
I am trying to set the workbookname in a sub procedure but it is not working.
Her are the part from my code that is not working:
Private Sub Start_Click()
Dim MalWb as workbook
Dim MalTxt as String
Set MalWb = Workbooks(ActiveWorkbook.Name)
MalTxt = ActiveWorkbook.Name
' Here I have som code to put data into MalWb
Call ReskontroArk("Kunder", MalTxt)
End Sub
Private Sub ReskontroArk(ReskontroType, MalTxt As Variant)
Dim MalWb As Workbook
Set MalWb = Workbooks(MalTxt) ' run time error 1004. Canot find file
End Sub
Can someone see what I have done wrong