I attaching here major part of my code to save the data of a range called guardar2 in one workbook into an second excel workbook which functions as the database.
While it was working fine upto now after I increased the guardar-range and increased it doesnot work any more giving error 1004 after inserting the new row in the database that is on line .activesheet..... = activesheet.....
I'm wasting my whole day on this problem and would be great of anybody has an idea what could be the problem? I even tried reducing Guardar2 to one data and saving it into A2 in the database also doesnot work.
Thanks!
Joke
Sub Button_guardar()
'
'in the original workshoot copy data to save into range guardar2
Sheet6.Range("guardar2").Value = Sheet6.Range("guardar1").Value
'location of the database
strFname = Range("ubicacion").Value
Set ActiveSh = ActiveSheet()
'open the databasefile
Set OpenedWb = Workbooks.Open(Filename:=strFname,WriteResPassword:=Sheet9.Range("password").Value)
'In the database enter a new row and save teh data of guardar 2
With OpenedWb
.ActiveSheet.Range("A2").EntireRow.Insert
.ActiveSheet.Range("a2:z2").Value = ActiveSh.Range("guardar2").Value
OpenedWb.Close (True)
End With
End Sub
While it was working fine upto now after I increased the guardar-range and increased it doesnot work any more giving error 1004 after inserting the new row in the database that is on line .activesheet..... = activesheet.....
I'm wasting my whole day on this problem and would be great of anybody has an idea what could be the problem? I even tried reducing Guardar2 to one data and saving it into A2 in the database also doesnot work.
Thanks!
Joke
Sub Button_guardar()
'
'in the original workshoot copy data to save into range guardar2
Sheet6.Range("guardar2").Value = Sheet6.Range("guardar1").Value
'location of the database
strFname = Range("ubicacion").Value
Set ActiveSh = ActiveSheet()
'open the databasefile
Set OpenedWb = Workbooks.Open(Filename:=strFname,WriteResPassword:=Sheet9.Range("password").Value)
'In the database enter a new row and save teh data of guardar 2
With OpenedWb
.ActiveSheet.Range("A2").EntireRow.Insert
.ActiveSheet.Range("a2:z2").Value = ActiveSh.Range("guardar2").Value
OpenedWb.Close (True)
End With
End Sub