Jump to content

Object required


likecoding

Recommended Posts

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 by likecoding
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...