Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Work-around for exporting sheet contents and removing code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arnold - 23 Jan 2007 15:45 GMT
Hi Everybody,
I'm trying to copy some contents of two sheets into a new workbook to
be saved on the user's desktop and attached to an email.  Ron's
send mail codes (http://www.rondebruin.nl/sendmail.htm) work great, but
I must get rid of all code behind the sheets in the new wbook.  I have
also used Chip's code at http://www.cpearson.com/excel/vbe.htm, but I
don't want to have to manually reference VBA Extensibility and set
the trust access to visual basic project on different computers.

Is there a way around this in Excel XP through code?

Or>>I've created a macro to simply copy the content from the active
wbook, create a new wbook, paste and format as needed, etc.-but
cannot figure out how to name the new wbook and save it to the user's
desktop.

How is it possible to create a unique name for the wbook (if Book1 or
Book2 or TodaysDate.xls is already present) and make this efficient?

Thanks,
Eric
Ron de Bruin - 23 Jan 2007 16:13 GMT
Hi Arnold

Install my mail add-in, you have a option to delete the VBA in there
http://www.rondebruin.nl/mail/add-in.htm

> don't want to have to manually reference VBA Extensibility and set
> the trust access to visual basic project on different computers.

No other way, my code check this setting

> How is it possible to create a unique name for the wbook (if Book1 or
> Book2 or TodaysDate.xls is already present) and make this efficient?

My code examples use the date/time in the file name

Signature

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm

> Hi Everybody,
> I'm trying to copy some contents of two sheets into a new workbook to
[quoted text clipped - 17 lines]
> Thanks,
> Eric
Arnold - 23 Jan 2007 20:12 GMT
Arnold - 24 Jan 2007 12:04 GMT
Now I have a question about the file sizes--my workbook is about 2.7
megs, and when I export 2 sheets using the add-in or sample code, the
exported file remains about 2 megs.  When the contents of the sheets
are selected manually, the size is considerably less.  There is not
much difference between the amount of data in the manual selection vs.
the entire 2 sheets--just formatting.  I've removed formatting in both
codes...  Any ideas?

Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.