Hi to all
I want to open a specific folder, find all Excel and from a specific Sheet take a parm cell value
The problem is i cant open the specific sheet and i need your help
All the others work without issues
The code (Function) i use to open the other excel and copy the specific cell is this
The Bold line is where i try to change to the sheet i want but of course is wrong
I want to open a specific folder, find all Excel and from a specific Sheet take a parm cell value
The problem is i cant open the specific sheet and i need your help
All the others work without issues
The code (Function) i use to open the other excel and copy the specific cell is this
Code:
Function OpenExcelFile(PathFolderName) As String
Dim objExcel As Object, objWorkbook As Object
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(PathFolderName)
[I][B] ActiveSheet.Name = TabName[/B][/I]
OpenExcelFile = objExcel.ActiveSheet.Range(CellName)
objWorkbook.Close False 'savechanges:=false
Set objExcel = Nothing
Set objWorkbook = Nothing
End Function
The Bold line is where i try to change to the sheet i want but of course is wrong