Hello!
I'm struggling to realize what i am doing wrong.
I have macro (let's call it macro1) that run macro from another workbook (macro2).
Years Macro2 was run perfectly from it's original file.
But when I tried first time to run macro2 from Macro1, macro2 stopped to run and started make the above error, even though I go back and try to run macro 2 from its original file.
Here is some code in macro2 that make the above error:
What am i doing wrong?
I want to use vars - wsPrm atc'
I'm struggling to realize what i am doing wrong.
I have macro (let's call it macro1) that run macro from another workbook (macro2).
Years Macro2 was run perfectly from it's original file.
But when I tried first time to run macro2 from Macro1, macro2 stopped to run and started make the above error, even though I go back and try to run macro 2 from its original file.
Here is some code in macro2 that make the above error:
Code:
'Define As Global Variables because i use them in the whole project'
Global wsSim, wsRes, wsOut, wsPrm As Worksheet
'Defining the Vars in the main Sub:
Set wb = ThisWorkbook
Set wsSim = wb.Worksheets("Simulator")
Set wsRes = wb.Worksheets("Results")
Set wsOut = wb.Worksheets("Output")
Set wsPrm = wb.Worksheets("Params")
'Defining vars in Sub:
Dim start_tranche As Integer
start_tranche = wsPrm.Range("start_tr").Value ' At this Line i get the error'
'But if i change code like this it runs fine:'
start_tranche = ThisWorkbook.Worksheets("Params").Range("start_tr").Value
What am i doing wrong?
I want to use vars - wsPrm atc'
Last edited: