Hello,
The code below was placed in module1 in book2. What it does it copied the data from book1 A1:A10.
I received an error "you are attempting to open file type(Web Pages and excell 2003 XML Spreadsheet) that has been Block by your file block Settings in the Trust Center."
So I went to File/Option/Trust Center/File Block Settings and I removed the check from Web Pages and Excel 2003 XML Spreadsheets and even I checked it or uncheck the code still not working.
When I clicked the macro button, it does something but it's not copying the data from Book1.
I did input the Full Path File under the Book1.xlm.
Please help!
Thank you
![]()
Sub get_data() Dim Wb1 As Workbook 'Dont update the screen - makes it work faster Application.ScreenUpdating = False 'Open the other workbook 'Input the FULL path to the file, including its extension Set Wb1 = Workbooks.Open("C:\Book1.xlm") 'You can do whatever you want here with the other workbook - it is now open. 'This just copies some cells. Wb1.Sheets(1).Range("A1:A10").Copy 'Close the workbook from which we just got some data and make sure not to save it in case accidental changes were made to it. Wb1.Close SaveChanges:=False 'Turn on screen updating again - makes Excel usable Application.ScreenUpdating = True End Sub
Bookmarks