Adding a sheet to a Addin

starnold007

New Member
Joined
Mar 5, 2009
Messages
1
I have a Addin that stores information on different sheets. I want to export the sheets to be able to have a back up of the information. I have been able to 'export' these sheets but I have been unable to 'import' them into my addin. I have been trying to use

masterItem - variable holding the name of the sheet selected from a Userform.

(prompts user to open the backup file he/she wants to import)

filename = application.getopenfilename..........
workbooks.open filename:=filename

Sheets(masterItem).Copy Before: = Workbooks("myaddinsname.xla).Sheets(4)

fyi-- i also want the new imported sheet to be xlSheetHidden.

I think my problem is that addin's are not a part of the Workbooks Collection???


Any help would be appreciated.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Untested for obvious reasons:
Code:
Sheets(masterItem).Copy Before: = ThisWorkbook.Sheets(4)
That said, it is not a good idea to update worksheets in an add-in. You should think of an add-in as "compiled code." And, one does not store data in compiled code. If you have data that match the code in a template, create a separate workbook that contains the data. Then, make sure that this workbook and the add-in always "travel together."
 
Upvote 0

Forum statistics

Threads
1,203,170
Messages
6,053,866
Members
444,690
Latest member
itgldmrt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top