Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Shapes in 2010

We have a quote sheet with a signature line and the user clicks a SIGN
SHEET button for which the code copies from a group of shapes with
user's signatures and places and aligns that shape on the signature
line. The code runs fine in 2003 & 2007, but it doesn't paste the
shape in 2010. The code runs through and doesn't crash, but it doesn't
paste the shape. Is it something I need to add to the code, a
reference checked on, or something else? See code below & any info on
this would be greatly appreciated.

Sub Sign()

Dim shp As Shape
Dim x As Integer
Dim c As Integer

Application.ScreenUpdating = False

If UCase(Application.UserName) Like "DAN*" Then c = 1
If UCase(Application.UserName) Like "ROB*" Then c = 2
If UCase(Application.UserName) Like "MELV*" Then c = 3
If UCase(Application.UserName) Like "GEO*" Then c = 4
If UCase(Application.UserName) Like "ABE*" Then c = 6
If UCase(Application.UserName) Like "ANN*" Then c = 6
If UCase(Application.UserName) Like "WAL*" Then c = 5

If UCase(Application.UserName) Like "CUR*" Then c = 6
If UCase(Application.UserName) Like "DARRE*" Then c = 6



Select Case c


Case 1
Set P = Sheets("Rates").Shapes("Object 3")
Range("Rep").Value = "Danny"


Case 2
Set P = Sheets("Rates").Shapes("Object 2")
Range("rep").Value = "Robert"

Case 3
Set P = Sheets("Rates").Shapes("Object 4")
Range("rep").Value = "Melvin"

Case 4
Set P = Sheets("Rates").Shapes("Picture 1")
Range("rep").Value = "George"

Case 5
Set P = Sheets("Rates").Shapes("Object 5")
Range("rep").Value = "Walt"

Case 6
PickName.Show 'USERFORM TO SELECT NAME

Case Else
MsgBox Application.UserName & " is not authorized to sign"
Exit Sub

End Select

'delete all objects and pictures from A and quote

Sheet1.Activate


For Each shp In ActiveSheet.Shapes
On Error Resume Next
If shp.Name Like "*Object*" Then shp.Delete
If shp.Name Like "*Picture*" Then shp.Delete
Next

Sheet2.Activate




For Each shp In ActiveSheet.Shapes
' On Error Resume Next
If shp.Name Like "*Object*" Then shp.Delete
If shp.Name Like "*Picture*" Then shp.Delete
Next

On Error GoTo 0



P.Copy
Sheet1.Select
Sheets("QUOTEA").Range("signature").Select
ActiveSheet.Paste



x = Range("signature").row

Selection.Top = Worksheets("QUOTEA").Cells(x + 1, 31).Top
Selection.Height = Worksheets("QUOTEA").Cells(x - 1, 31).Top -
Worksheets("QUOTEA").Cells(x + 1, 31).Top
Selection.Left = Worksheets("QUOTEA").Range("signature").Left

Sheet2.Select

Sheets("Quote").Range("Q_Rep").Select
ActiveSheet.Paste

x = Range("Q_rep").row

Selection.Top = Worksheets("Quote").Cells(x, 31).Top
Selection.Height = Worksheets("Quote").Cells(x, 31).Height
Selection.Left = Worksheets("Quote").Range("Q_Rep").Left


Cells(1, 1).Activate

Sheet1.Activate

Application.CutCopyMode = False

Cells(1, 1).Activate

Application.ScreenUpdating = True

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Shapes in 2010

Some observations and suggestions...

"P" is not declared.
You reference 5 different sheets: Rates, Quote, QuoteA, Sheet1, Sheet2
Some possible overlap there.
Case 6 shows no code for identifying a particular shape.
'---

Remove all "On Error Resume Next" statements to be sure some code isn't being skipped.
Check the Rates sheet and verify the shape names are what you think they are.
'---

Try these alternative paste methods...
P.Copy
Sheets("QUOTEA").Range("signature").PasteSpecial
-or-
P.Copy
Sheets("QUOTEA").Paste Destination:=Sheets("QUOTEA").Range("signature")

--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(List Files XL add-in: finds and lists files/folders with hyperlinks)





"Darrell L."
wrote in message
...
We have a quote sheet with a signature line and the user clicks a SIGN
SHEET button for which the code copies from a group of shapes with
user's signatures and places and aligns that shape on the signature
line. The code runs fine in 2003 & 2007, but it doesn't paste the
shape in 2010. The code runs through and doesn't crash, but it doesn't
paste the shape. Is it something I need to add to the code, a
reference checked on, or something else? See code below & any info on
this would be greatly appreciated.

Sub Sign()

Dim shp As Shape
Dim x As Integer
Dim c As Integer

Application.ScreenUpdating = False

If UCase(Application.UserName) Like "DAN*" Then c = 1
If UCase(Application.UserName) Like "ROB*" Then c = 2
If UCase(Application.UserName) Like "MELV*" Then c = 3
If UCase(Application.UserName) Like "GEO*" Then c = 4
If UCase(Application.UserName) Like "ABE*" Then c = 6
If UCase(Application.UserName) Like "ANN*" Then c = 6
If UCase(Application.UserName) Like "WAL*" Then c = 5

If UCase(Application.UserName) Like "CUR*" Then c = 6
If UCase(Application.UserName) Like "DARRE*" Then c = 6

Select Case c
Case 1
Set P = Sheets("Rates").Shapes("Object 3")
Range("Rep").Value = "Danny"


Case 2
Set P = Sheets("Rates").Shapes("Object 2")
Range("rep").Value = "Robert"
Case 3
Set P = Sheets("Rates").Shapes("Object 4")
Range("rep").Value = "Melvin"
Case 4
Set P = Sheets("Rates").Shapes("Picture 1")
Range("rep").Value = "George"
Case 5
Set P = Sheets("Rates").Shapes("Object 5")
Range("rep").Value = "Walt"
Case 6
PickName.Show 'USERFORM TO SELECT NAME
Case Else
MsgBox Application.UserName & " is not authorized to sign"
Exit Sub
End Select

'delete all objects and pictures from A and quote

Sheet1.Activate
For Each shp In ActiveSheet.Shapes
On Error Resume Next
If shp.Name Like "*Object*" Then shp.Delete
If shp.Name Like "*Picture*" Then shp.Delete
Next

Sheet2.Activate
For Each shp In ActiveSheet.Shapes
' On Error Resume Next
If shp.Name Like "*Object*" Then shp.Delete
If shp.Name Like "*Picture*" Then shp.Delete
Next

On Error GoTo 0
P.Copy
Sheet1.Select
Sheets("QUOTEA").Range("signature").Select
ActiveSheet.Paste


x = Range("signature").row

Selection.Top = Worksheets("QUOTEA").Cells(x + 1, 31).Top
Selection.Height = Worksheets("QUOTEA").Cells(x - 1, 31).Top -
Worksheets("QUOTEA").Cells(x + 1, 31).Top
Selection.Left = Worksheets("QUOTEA").Range("signature").Left

Sheet2.Select

Sheets("Quote").Range("Q_Rep").Select
ActiveSheet.Paste

x = Range("Q_rep").row

Selection.Top = Worksheets("Quote").Cells(x, 31).Top
Selection.Height = Worksheets("Quote").Cells(x, 31).Height
Selection.Left = Worksheets("Quote").Range("Q_Rep").Left
Cells(1, 1).Activate
Sheet1.Activate
Application.CutCopyMode = False
Cells(1, 1).Activate
Application.ScreenUpdating = True
End Sub



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
OnAction bei vielen Shapes ... ich meine sehr viele Shapes? Michael[_52_] Excel Programming 1 February 26th 11 08:38 AM
Form 4 Range of time from 1/20/2010 4:00 AM To 1/21/2010 10:00 AM Peter Gonzalez[_2_] Excel Worksheet Functions 2 January 26th 10 06:58 PM
excel document with shapes on it but the shapes do not print [email protected] Excel Worksheet Functions 2 October 22nd 09 06:17 PM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM


All times are GMT +1. The time now is 12:36 PM.

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"