likecoding Posted December 2, 2018 Share Posted December 2, 2018 (edited) Hello, I am trying to pass excel sheet to a function. I am getting an error in call2 function "object required" in this line: CurrentValue = SheetOne.Cells(2,2) Complete code: Set ExcelObj = createobject("excel.application") ExcelObj.Visible = true Set ExcelConfigFile = ExcelObj.Workbooks.Open (configFilePath) Set ConfigScriptSheet = ExcelConfigFile.Worksheets("Scripts") call1(ConfigScriptSheet) Function call2(SheetOne) ColumnCounter = 1 For ExcelRow = 1 To TotalColumn CurrentValue = SheetOne.Cells(2,2) // I get error "object required" ............... Next End Function Function call1(ConfigScripSheet) ValidateConfigFileTemplate = 1 ColumnNo1 = call2 (ConfigScriptSheet) .................... End Function Thanks. Edited December 2, 2018 by likecoding Link to comment Share on other sites More sharing options...
justsomeguy Posted December 3, 2018 Share Posted December 3, 2018 Check your variable spelling. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now