jamiguel77
Active Member
- Joined
- Feb 14, 2006
- Messages
- 387
- Office Version
- 2016
- 2010
- 2007
- Platform
- Windows
- Web
Dim my_FileName As Variant
my_FileName = Application.GetOpenFilename(FileFilter:="Excel Files,*.xl*;*.xm*")
If my_FileName <> False Then
Workbooks.Open Filename:=my_FileName
Dim xActiveSheet As Worksheet
Set xActiveSheet = ThisWorkbook.ActiveSheet
Dim NewSheet As Worksheet
Dim wavanza As Boolean
Dim wrowIni As Integer
ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)).Name = "Resumen"
i test this code, open the file, but in this line:
ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)).Name = "Resumen"
i get this error:
Error '1004' this name is ocuppied try with another...
but the file havent a sheet named "Resumen"
any advice how to assign the workbook opened to thisWorkbook?
Thanks.
my_FileName = Application.GetOpenFilename(FileFilter:="Excel Files,*.xl*;*.xm*")
If my_FileName <> False Then
Workbooks.Open Filename:=my_FileName
Dim xActiveSheet As Worksheet
Set xActiveSheet = ThisWorkbook.ActiveSheet
Dim NewSheet As Worksheet
Dim wavanza As Boolean
Dim wrowIni As Integer
ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)).Name = "Resumen"
i test this code, open the file, but in this line:
ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)).Name = "Resumen"
i get this error:
Error '1004' this name is ocuppied try with another...
but the file havent a sheet named "Resumen"
any advice how to assign the workbook opened to thisWorkbook?
Thanks.