View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Samuel Barnhouse Samuel Barnhouse is offline
external usenet poster
 
Posts: 2
Default Application activation and pasting

Both of these examples worked great.

I have figured out a problem, however. I am pulling via Oracle a ton of data
and then sorting and orgranizing the data. This macro will be used on a
scheduler to run once per month to pull the data and save the file out to a
network drive (All of that is complete). I realized, however that I need all
of the sheets in the workbook, not just the first sheet. So basically I need
to save the entire workbook out, except with NO macros in the workbook...

Again Thanks!!
Sam Barnhouse


"Samuel Barnhouse" wrote in message
news:Q0h4e.179$KI6.60@okepread07...
All,

I am trying to create a macro to select all data in a current workbook,
copy it to the clipboard, create a new workbook and paste the data into
that workbook. This is a sample of the code I am using:

Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Workbooks.Add
Workbooks(2).Activate
Range("A1").Select
ActiveSheet.Paste

This code results in a new workbook being generated, the focus going to
the new workbook, but the paste command is pasted overtop of my original
spreadsheet... Any help would be appriciated.

Thank you,
Sam Barnhouse