This is my code:
I want to transfer data from the backup file I create.
But error 1004 appear.
certain my .exe cells where the data should be transfer use dropdown and not lock.
please review my code below where the error:
Sub BackupDataInfo1()
Dim strFile As String
'Backup Info 1
Workbooks.Add xlWBATWorksheet
ActiveSheet.Name = “Info1”
ActiveWorkbook.Sheets(“Info1”).Range(“B9:S39”).Value = ThisWorkbook.Sheets(“Info1”).Range(“B9:S39”).Value
strFile = Application.GetSaveAsFilename(“Backup Info 1”, “Excel workbook (.xlsx),.xlsx”, 1)
If strFile <> “False” Then ActiveWorkbook.SaveAs strFile, FileFormat:=51
ActiveWorkbook.Close False
End Sub
Sub Open_Workbook_DialogInfo1()
Dim my_FileName As Variant
my_FileName = Application.GetOpenFilename( _
FileFilter:=“Excel Files,.xl;.xm”, _
FilterIndex:=3, _
Title:=“Find File named - Backup Info 1”, _
MultiSelect:=False)
If my_FileName <> False Then
Workbooks.Open Filename:=my_FileName
End If
End Sub
Sub TransferDataInfo1()
If Workbooks.Count > 1 Then
Workbooks(1).Sheets(“Info1”).Range(“I10,I12,I14,I16,I17,K17,O10,O15,O17,I20,K20,M20,O20,B10,B21,B25,I22,K22,M22,O22,I23,K23,M23,O23,I25,K25,M25,O25,I26,K26,M26,O26,I28,K28,M28,028,I30,M30,I32,I36,K36”).Value = Workbooks(2).Sheets(“Info1”).Range(“I10,I12,I14,I16,I17,K17,O10,O15,O17,I20,K20,M20,O20,B10,B21,B25,I22,K22,M22,O22,I23,K23,M23,O23,I25,K25,M25,O25,I26,K26,M26,O26,I28,K28,M28,028,I30,M30,I32,I36,K36”).Value
Workbooks(2).Close savechanges:=False
Else
MsgBox “The data hasn’t been transferred.”, vbExclamation, “Error”
End If
End Sub
Sub TheTransferInfo1()
Call Open_Workbook_DialogInfo1
Call TransferDataInfo1
End Sub
Thank you for your response.