Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Select All and copy and paste

Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the worksheet
copy / move method. Also, in this method the data does not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the clipboard.
Moreover, If I need to copy the whole work book, I need to
copy the sheets one by one. Is there a simpler way to do
this?
(something similar to select all and copy and paste. If we
do this in word, even the header footer and the styles get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select All and copy and paste

Maybe you mean this

requirement is to duplicate a existing / a open Excel Workbook


ActiveWorkbook.SaveCopyAs "C:\something.xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ashok" wrote in message ...
Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the worksheet
copy / move method. Also, in this method the data does not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the clipboard.
Moreover, If I need to copy the whole work book, I need to
copy the sheets one by one. Is there a simpler way to do
this?
(something similar to select all and copy and paste. If we
do this in word, even the header footer and the styles get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Select All and copy and paste

Not exactly, I dont want to save the workbook and copy it
as a file nor saveas or save a copy as. I want something
equivalent to select all which should select all the
elements of a workbook, like all the worksheets and the
chart and pivot tables, the data, formula, etc. and copy
it and probably paste it in a new workbook or a existing
open workbook.

Thanks
Ashok
-----Original Message-----
Maybe you mean this

requirement is to duplicate a existing / a open Excel

Workbook

ActiveWorkbook.SaveCopyAs "C:\something.xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ashok" wrote in

message ...
Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the worksheet
copy / move method. Also, in this method the data does

not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the

clipboard.
Moreover, If I need to copy the whole work book, I need

to
copy the sheets one by one. Is there a simpler way to do
this?
(something similar to select all and copy and paste. If

we
do this in word, even the header footer and the styles

get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select All and copy and paste

With Workbooks("Destination.xls")
Activeworkbook.sheets.copy After:=.Sheets(.Sheets.count)
End With

--
Regards,
Tom Ogilvy

wrote in message
...
Not exactly, I dont want to save the workbook and copy it
as a file nor saveas or save a copy as. I want something
equivalent to select all which should select all the
elements of a workbook, like all the worksheets and the
chart and pivot tables, the data, formula, etc. and copy
it and probably paste it in a new workbook or a existing
open workbook.

Thanks
Ashok
-----Original Message-----
Maybe you mean this

requirement is to duplicate a existing / a open Excel

Workbook

ActiveWorkbook.SaveCopyAs "C:\something.xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ashok" wrote in

message ...
Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the worksheet
copy / move method. Also, in this method the data does

not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the

clipboard.
Moreover, If I need to copy the whole work book, I need

to
copy the sheets one by one. Is there a simpler way to do
this?
(something similar to select all and copy and paste. If

we
do this in word, even the header footer and the styles

get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Select All and copy and paste

Thanks for the code snipet. This was the approach that i
had intially used. But the problem with this is, the
source workbook has to be open for the copy to work and so
does the Excel application. If as a com addin, if i give
this functionalty, we cant expect the user to keep the
source workbook open or the user might click on copy and
close the excel itself and reopen excel and paste. Is
there a way to select all the elements and put in a
clipboard or something and paste it from the clipboard,
which would be ideal and would solve both the problems
that i have.

Thanks
Ashok
-----Original Message-----
With Workbooks("Destination.xls")
Activeworkbook.sheets.copy After:=.Sheets(.Sheets.count)
End With

--
Regards,
Tom Ogilvy

wrote in message
...
Not exactly, I dont want to save the workbook and copy

it
as a file nor saveas or save a copy as. I want something
equivalent to select all which should select all the
elements of a workbook, like all the worksheets and the
chart and pivot tables, the data, formula, etc. and copy
it and probably paste it in a new workbook or a existing
open workbook.

Thanks
Ashok
-----Original Message-----
Maybe you mean this

requirement is to duplicate a existing / a open Excel

Workbook

ActiveWorkbook.SaveCopyAs "C:\something.xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ashok" wrote in

message ...
Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the

worksheet
copy / move method. Also, in this method the data

does
not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the

clipboard.
Moreover, If I need to copy the whole work book, I

need
to
copy the sheets one by one. Is there a simpler way

to do
this?
(something similar to select all and copy and paste.

If
we
do this in word, even the header footer and the

styles
get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok



.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select All and copy and paste

No, you can't use the vba copy method unless both workbooks are open in
Excel.

You should be able to accomplish that with your code, including guarding
against problems such as the workbook not being accessible.

--
Regards,
Tom Ogilvy

"Ashok" wrote in message
...
Thanks for the code snipet. This was the approach that i
had intially used. But the problem with this is, the
source workbook has to be open for the copy to work and so
does the Excel application. If as a com addin, if i give
this functionalty, we cant expect the user to keep the
source workbook open or the user might click on copy and
close the excel itself and reopen excel and paste. Is
there a way to select all the elements and put in a
clipboard or something and paste it from the clipboard,
which would be ideal and would solve both the problems
that i have.

Thanks
Ashok
-----Original Message-----
With Workbooks("Destination.xls")
Activeworkbook.sheets.copy After:=.Sheets(.Sheets.count)
End With

--
Regards,
Tom Ogilvy

wrote in message
...
Not exactly, I dont want to save the workbook and copy

it
as a file nor saveas or save a copy as. I want something
equivalent to select all which should select all the
elements of a workbook, like all the worksheets and the
chart and pivot tables, the data, formula, etc. and copy
it and probably paste it in a new workbook or a existing
open workbook.

Thanks
Ashok
-----Original Message-----
Maybe you mean this

requirement is to duplicate a existing / a open Excel
Workbook

ActiveWorkbook.SaveCopyAs "C:\something.xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ashok" wrote in
message ...
Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the

worksheet
copy / move method. Also, in this method the data

does
not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the
clipboard.
Moreover, If I need to copy the whole work book, I

need
to
copy the sheets one by one. Is there a simpler way

to do
this?
(something similar to select all and copy and paste.

If
we
do this in word, even the header footer and the

styles
get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok



.



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Select All and copy and paste

If the workbook is not open, couldn't you just use FileCopy (see VBA help for
detail) to copy it to a new file/location?

Ashok wrote:

Thanks for the code snipet. This was the approach that i
had intially used. But the problem with this is, the
source workbook has to be open for the copy to work and so
does the Excel application. If as a com addin, if i give
this functionalty, we cant expect the user to keep the
source workbook open or the user might click on copy and
close the excel itself and reopen excel and paste. Is
there a way to select all the elements and put in a
clipboard or something and paste it from the clipboard,
which would be ideal and would solve both the problems
that i have.

Thanks
Ashok
-----Original Message-----
With Workbooks("Destination.xls")
Activeworkbook.sheets.copy After:=.Sheets(.Sheets.count)
End With

--
Regards,
Tom Ogilvy

wrote in message
...
Not exactly, I dont want to save the workbook and copy

it
as a file nor saveas or save a copy as. I want something
equivalent to select all which should select all the
elements of a workbook, like all the worksheets and the
chart and pivot tables, the data, formula, etc. and copy
it and probably paste it in a new workbook or a existing
open workbook.

Thanks
Ashok
-----Original Message-----
Maybe you mean this

requirement is to duplicate a existing / a open Excel
Workbook

ActiveWorkbook.SaveCopyAs "C:\something.xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ashok" wrote in
message ...
Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the

worksheet
copy / move method. Also, in this method the data

does
not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the
clipboard.
Moreover, If I need to copy the whole work book, I

need
to
copy the sheets one by one. Is there a simpler way

to do
this?
(something similar to select all and copy and paste.

If
we
do this in word, even the header footer and the

styles
get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok



.



.


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select All and copy and paste

Not exactly, I dont want to save the workbook and copy it
as a file nor saveas or save a copy as.

He already rejected that.

--
Regards,
Tom Ogilvy

Dave Peterson wrote in message
...
If the workbook is not open, couldn't you just use FileCopy (see VBA help

for
detail) to copy it to a new file/location?

Ashok wrote:

Thanks for the code snipet. This was the approach that i
had intially used. But the problem with this is, the
source workbook has to be open for the copy to work and so
does the Excel application. If as a com addin, if i give
this functionalty, we cant expect the user to keep the
source workbook open or the user might click on copy and
close the excel itself and reopen excel and paste. Is
there a way to select all the elements and put in a
clipboard or something and paste it from the clipboard,
which would be ideal and would solve both the problems
that i have.

Thanks
Ashok
-----Original Message-----
With Workbooks("Destination.xls")
Activeworkbook.sheets.copy After:=.Sheets(.Sheets.count)
End With

--
Regards,
Tom Ogilvy

wrote in message
...
Not exactly, I dont want to save the workbook and copy

it
as a file nor saveas or save a copy as. I want something
equivalent to select all which should select all the
elements of a workbook, like all the worksheets and the
chart and pivot tables, the data, formula, etc. and copy
it and probably paste it in a new workbook or a existing
open workbook.

Thanks
Ashok
-----Original Message-----
Maybe you mean this

requirement is to duplicate a existing / a open Excel
Workbook

ActiveWorkbook.SaveCopyAs "C:\something.xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ashok" wrote in
message ...
Hi,
I am writing a macro / Com Addin, in which one the
requirement is to duplicate a existing / a open Excel
Workbook. The only thing that i found was the

worksheet
copy / move method. Also, in this method the data

does
not
go to the clipboard, So if i copy something and close
excel and reopen, i will not have anything the
clipboard.
Moreover, If I need to copy the whole work book, I

need
to
copy the sheets one by one. Is there a simpler way

to do
this?
(something similar to select all and copy and paste.

If
we
do this in word, even the header footer and the

styles
get
copied). For some reasons, I dont want save the
Workbook and copy the file to duplicate the
workbook.

Thanks in advance

Ashok



.



.


--

Dave Peterson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select, find in another book, copy, return and paste Watson[_2_] Excel Discussion (Misc queries) 0 August 15th 08 07:14 PM
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. tln Links and Linking in Excel 0 April 22nd 07 04:28 PM
Not using select for copy and paste damorrison Excel Discussion (Misc queries) 2 April 8th 07 08:41 PM
Select cell, Copy it, Paste it, Return to Previous cell spydor Excel Discussion (Misc queries) 1 December 30th 05 01:29 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM


All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"