Solved

copy paste embedded shapes between hidden worksheets

Posted on 2013-11-16
8
295 Views
Last Modified: 2013-11-20
Hello,

The code below has been implemented to:

1. delete existing OLE shapes from hidden worksheet 1
2. copy new OLE shapes from hidden worksheet 2
3. paste the copied shapes in hidden worksheet 1

The command button is on a worksheet 3, which is the only visible sheet to the user.

The code works fine for steps 1 and 2, but doesn't work for step 3 (pasting the shapes to hidden worksheet 1).

The code is as follows:

Private Sub CommandButton1_Click()


 ThisWorkbook.Worksheets("6").Shapes.Range(Array("1", "2", "3", "4", "5")).Delete

 
    ThisWorkbook.Worksheets("7").Shapes.Range(Array("1", "2", "3", "4", "5")).Select
    Selection.Copy
   
       ThisWorkbook.Worksheets("6").Select
    Selection.Paste

End Sub


The answer appears so close - all help appreciated.
0
Comment
Question by:Senechal
  • 4
  • 4
8 Comments
 
LVL 29

Expert Comment

by:gowflow
ID: 39653576
replace this
Selection.Paste

by this
Selection.PasteSpecial

gowflow
0
 

Author Comment

by:Senechal
ID: 39654183
Hello gowflow,

Thank you for the suggestion, but the results are still the same as before: the deletion takes place OK, but not the copy and paste. I'm attaching a demo file in case this is any help.
DemoCopyPasteOLE.xlsm
0
 
LVL 29

Accepted Solution

by:
gowflow earned 500 total points
ID: 39654221
Here is it
gowflow
DemoCopyPasteOLE.xlsm
0
 

Author Comment

by:Senechal
ID: 39654737
Hi goflow,

Your solution works perfectly. Thank you so much.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Senechal
ID: 39654745
I've requested that this question be closed as follows:

Accepted answer: 0 points for Senechal's comment #a39654737

for the following reason:

Solution by goflow.
0
 
LVL 29

Expert Comment

by:gowflow
ID: 39654746
I am objecting to this closure as supposed the asker made a mistake in closing it by awarding himself 0 points but no points to the correct answer. His comments clearly indicate that I provided the solution for him.
Tks/gowflow
0
 

Author Comment

by:Senechal
ID: 39655676
Gowflow provided an excellent solution and I cannot thank him enough for his courtesy and speed. It is absolutely worth 500 points. This is the first time I've used this system, so the mistake in point-setting was entirely mine.
0
 
LVL 29

Expert Comment

by:gowflow
ID: 39656725
No problem don't worry I thought so. Pls feel free to put any comment on this question case you need further help with any other question. I will keep this one monitored.
gowflow
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now