Solved

VSTO Copy single worksheet to new workbook without customizations

Posted on 2010-11-17
1
1,337 Views
Last Modified: 2012-08-13
I have a document-level Excel-based VSTO application written in VB.Net.   I would like to take a single worksheet from this application and copy it over to a brand new workbook without any of the VSTO code.   I have tried doing a SaveAs on the Activesheet to a specified name and that copies the worksheet to a new workbook with the customization but it is exceptionally slow.  Even slower when I use the serverdocument.removecustmization method.

What I would like to do is to create a new workbook and then copy my singel sheet over and then save it.  If I use something similar to this:

            Dim ws As Excel.Worksheet
            ws = Globals.ThisWorkbook.ActiveSheet
            ws.Copy()

I  quickly get my sheet copied to a new workbook but I don't quite how to save it.

Thoughts and suggestions are appreciated.
0
Comment
Question by:AddOnsInc
1 Comment
 

Accepted Solution

by:
AddOnsInc earned 0 total points
ID: 34161183
I guess I should have performed a few more searches because I found the perfect solution at http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/779c42b4-f298-4dbd-af3b-39784b04ae78

0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question