Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problem copying from a hidden worksheet (data is copied, but alsoadditional sheet info)

I've only used dataobject to copy single values.

How about a different approach?

You tell the user to select the destination cell, then do the rest in code.
Open the sending workbook (in readonly mode) in the same instance, do the
copy|paste and then close the sending workbook.

If this doesn't work for you and you don't get a better answer here, you may
want to ask in a VB group. Maybe some of those users are more familiar with
dataobject????



wrote:

On 31 Jan, 15:39, Dave Peterson wrote:
So I have a question for you.

Are you pasting just the value or do you want to include formatting?

If you're pasting just values, your code could use the windows clipboard.

Option Explicit
Sub testme()

Dim MyDataObj As DataObject
Dim myVal As Variant

Set MyDataObj = New DataObject

myVal = Sheet1.Range("A1").Value
MyDataObj.SetText myVal
MyDataObj.PutInClipboard

End Sub


Thanks Dave, I didn't know about the DataObject, so it was a useful
post for me.
I am happy to get the values only, but my example was simplified: in
the real application, I need to copy a table from the spreadsheet, so
"myVal" would end up being an array of variants. It seems to me that
MyDataObj.SetText can only work on strings. CPearson's website was
also useful, but didn't mention the case of copying anything different
from a string. Is that be possible?

In any case, thanks for your reply. BTW my system is: "Windows XP
Professional" and Excel 2003 SP2
gc


--

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
Copied info from Excel worksheet, but pasted info won't work in fo KRISTENV Excel Discussion (Misc queries) 3 January 8th 09 03:13 PM
Problem copying from a hidden worksheet (data is copied, but alsoadditional sheet info) Susan Excel Programming 0 January 31st 08 03:35 PM
how to update a worksheet and have data copied to another sheet? tsuriman3 Excel Worksheet Functions 2 January 4th 08 01:34 AM
Copied empty cells, give sorting problem in Data sheet Ruud[_2_] Excel Programming 0 September 16th 04 04:44 AM
Saving hidden data with a worksheet (preferably without using a hidden sheet) Dick Kusleika[_3_] Excel Programming 2 January 21st 04 04:39 PM


All times are GMT +1. The time now is 07:50 AM.

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

About Us

"It's about Microsoft Excel"