View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Confused Slug Confused Slug is offline
external usenet poster
 
Posts: 8
Default Copy /Pastespecial Textboxes

I am using the code below to format a spreadsheet from within Access. After
copying sheet1 I then use pastespecial to remove links to the data on sheet 2
before deleting sheet2. When i use this in 2003 all is well. However, in 2007
the
copy / pastespecial does not appear to copy and paste the data in any
Textboxes on sheet1. Is this the real problem? Why does this occur and how
can i over come the issue? Any info greatfully recieved.


Set xlWb = xlApp.Workbooks.Open(newFileName)
xlApp.Visible = True

' Formats Excel Workbook
Dim xlSheet As Object
Set xlSheet = xlWb.Worksheets("Sheet1")
xlSheet.Cells.Copy
xlSheet.Cells.PasteSpecial Paste:=-4163, Operation:=-4142,
SkipBlanks:=False, Transpose:=False
xlWb.Worksheets("Sheet2").Delete
xlSheet.Select
xlSheet.Range("A1").Select
xlSheet.Protect ("secret")
..........