Solved

paste method not working in vb 6.0

Posted on 2007-03-29
1
177 Views
Last Modified: 2010-05-03
What is wrong with the code in the line marked.

For OutVar = 2 To TotalVariableCount + 1 'COPY ALL THE ACTUAL DATA POINT TO THE ERRORFUNCTIONALL
FinalSheet.range(FinalSheet.Cells(2, OutVar), FinalSheet.Cells(ACTUALDATAPOINTS + 1, OutVar)).Copy
cellvalue = ColCounter * ACTUALDATAPOINTS + 2
ErrorAllsheet.range(ErrorAllsheet.Cells(cellvalue, 1), ErrorAllsheet.Cells(cellvalue, 1)).Paste <------
ColCounter = ColCounter + 1

Next OutVar
0
Comment
Question by:Aiysha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
mvidas earned 500 total points
ID: 18818690
Hi Aiysha,

.Paste only works on a worksheet variable, not on a range like you have. You could either put .PasteSpecial instead, or put that range as the Destination argument of the .Copy method (my recommendation):

For OutVar = 2 To TotalVariableCount + 1 'COPY ALL THE ACTUAL DATA POINT TO THE ERRORFUNCTIONALL
FinalSheet.range(FinalSheet.Cells(2, OutVar), FinalSheet.Cells(ACTUALDATAPOINTS + 1, OutVar)).Copy ErrorAllsheet.Cells(ColCounter * ACTUALDATAPOINTS + 2, 1)
ColCounter = ColCounter + 1

Next OutVar

Matt
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

752 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