What i need is to copy a specific worksheet at the current workbook i'm working, I know that i can use move or copy tool but i want to do a macro and add it to and excel add-in, i tried this code and it works, the thing is that it should be executed from the workbook where i want to paste the sheet. the code doesn't work when i put it on an excel add-in.
So to make it clear the excel book with the worksheet that i want to paste is always located at the same folder, what i want is to bring a copy of that sheet to the current book that i'm working.
(code above works, it can bring ALL the worksheets from ALL the workbooks in a specific folder to one single workbook)
but i want it within an add-in.
please, i need some ideas
Thanks in advance.
Code:
Sub GetSheets()
Path = "C:\Users\OutsourcingSOS\Dropbox\List Build Queue\Don't open this folder\"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
So to make it clear the excel book with the worksheet that i want to paste is always located at the same folder, what i want is to bring a copy of that sheet to the current book that i'm working.
(code above works, it can bring ALL the worksheets from ALL the workbooks in a specific folder to one single workbook)
but i want it within an add-in.
please, i need some ideas
Thanks in advance.