ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save text of spreadsheet--without macros or data query (https://www.excelbanter.com/excel-programming/320636-save-text-spreadsheet-without-macros-data-query.html)

Bryan Dickerson

Save text of spreadsheet--without macros or data query
 
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!



Tom Ogilvy

Save text of spreadsheet--without macros or data query
 
' 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


--
Regards,
Tom Ogilvy


"Bryan Dickerson" wrote in message
...
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!





Bryan Dickerson

Save text of spreadsheet--without macros or data query
 
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?


"Tom Ogilvy" wrote in message
...
' 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


--
Regards,
Tom Ogilvy


"Bryan Dickerson" wrote in message
...
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!







Tom Ogilvy

Save text of spreadsheet--without macros or data query
 
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 )

--
Regards,
Tom Ogilvy




"Bryan Dickerson" wrote in message
...
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?


"Tom Ogilvy" wrote in message
...
' 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


--
Regards,
Tom Ogilvy


"Bryan Dickerson" wrote in message
...
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!










All times are GMT +1. The time now is 02:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com