Save text of spreadsheet--without macros or data query

  • Thread starter Thread starter Bryan Dickerson
  • Start date Start date
B

Bryan Dickerson

I have a spreadsheet that I have built for a user and she wishes to be able
to send the spreadsheet, which is the result of an SQL stored procedure and
which also has some VBA for her in it, without all the query or VBA stuff
via email or some such. So my first question is: how do I programmatically
save the spreadsheet without the "extras" for her so that the user will not
see anything but numbers? I figure I can get the email part, but if someone
could suggest something on the save part, that would be really cool!!

TIA!
 
' Create a copy of the sheet in a new workbook
ActiveSheet.copy
Activesheet.Cells.Copy
ActiveSheet.Cells.PasteSpecial xlValues
activeWorkbook.Send . . .
ActiveWorkbook.Close SaveChanges:=False
 
Maybe I'm not thinking or maybe you were just giving me the highlights of
what would be needed or maybe both, but wouldn't

ActiveSheet.Cells.Copy , then
ActiveSheet.Cells.PasteSpecial xlValues

.... just copy and paste the cells on top of themselves?
 
Yes - but that is the part that would answer the part about
So my first question is: how do I programmatically
save the spreadsheet without the "extras" for her so that the user will not
see anything but numbers?

That should leave nothing but numbers on the sheet (removes formulas, links,
pivot tables, query tables.) However, we haven't addressed thinks like code
in the sheet module or buttons or other objects on the sheet. You really
didn't add any information about what the "extras" are that you want to
eliminate. The "query" could possibly be a vba procedure, a pivot table, a
querytable. So I gave a generalized approach, but specific code would be
needed for some specific items. Copying just the sheet to a new workbook
should eliminate any code except code in the sheet module (if there is code
in the sheet module then see Chip Pearson's page
http://www.cpearson.com/excel/vbe.htm )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top