Run Time Error '1004' Application or Onject-defined

Hi all.
I am having a strange problem with the below code in that it produces the 
run time error when trying to Paste the Selection.
However, if I perform the action manually in exactly the same way, as in 
recording the macro in the first place, it works!?
How can I get this to run - it is after all, a really simple code. (Most 
frustrating)
Thanks, Wes.


Windows("Transaction_Record.xlsm").Activate
    Sheets("DETAILED_PMNTS_REC").Select
    Range("N2077:QV2089").Select
    Application.CutCopyMode = False
    Selection.Copy
Windows("AUDIT_TRAIL.xlsm").Activate
    Sheets("AUDIT_TRAIL_MONTHLY").Select
    Range("B74").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, 
SkipBlanks_:=False, Transpose:=False
0
Utf
4/21/2010 3:44:01 AM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
1041 Views

Similar Articles

[PageSpeed] 53

Try the below....which uses the worksheet object..

Edit the sheet names to suit

Sub Macro()

Dim wsSource As Worksheet, wsTarget As Worksheet

Set wsSource = Workbooks("Transaction_Record.xlsm").Sheets("Sheetname")
Set wsTarget = Workbooks("AUDIT_TRAIL.xlsm").Sheets("Sheetname")

wsSource.Range("N2077:QV2089").Copy
wsTarget.Range("B74").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

End Sub


-- 
Jacob (MVP - Excel)


"Wes_A" wrote:

> Hi all.
> I am having a strange problem with the below code in that it produces the 
> run time error when trying to Paste the Selection.
> However, if I perform the action manually in exactly the same way, as in 
> recording the macro in the first place, it works!?
> How can I get this to run - it is after all, a really simple code. (Most 
> frustrating)
> Thanks, Wes.
> 
> 
> Windows("Transaction_Record.xlsm").Activate
>     Sheets("DETAILED_PMNTS_REC").Select
>     Range("N2077:QV2089").Select
>     Application.CutCopyMode = False
>     Selection.Copy
> Windows("AUDIT_TRAIL.xlsm").Activate
>     Sheets("AUDIT_TRAIL_MONTHLY").Select
>     Range("B74").Select
>     Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, 
> SkipBlanks_:=False, Transpose:=False
0
Utf
4/21/2010 4:46:01 AM
Reply:

Similar Artilces:

Business Portal Error-SQL server does not exist or access denied
Hi, We are running business portal 4.0 for one of our customer. It was running correctly, however, they have changed the SQL server port (previously it was set as default 1433). After that the business portal becomes very slow and while creating a new request (purchase requisition) if we open the item pop up; it is showing exception "SQL Server does not exist or access denied...." Can any body tell me how can I provide the new port number to business portal connection to the database. Thanks and Regards, Waliullah, Thanks for using the newsgroups. I have a...

crm 3.0 error 03-01-06
Hello, I'me getting this error while installing crm3.0 for SBS: "error writing to file microsoft.mshtml.dll verify that you have access to that directory" That file is in the C:\Program Files\Microsoft.NET\Primary Interop Assemblies directory. I (and 'everyone') has full access to that dir. What can I do about this?? kind regards, Thomas ...

Error in Outlook Today
Whenever I go to Outlook Today, I get a runtime error, line: 297 Error: Class Not Registered. Then I get the error two more times when I click 'Customize Outlook Today...' and the list 'Show Outlook Today In This Style' is empty, and the box under it has a broken image icon. What could be the cause of this? Sorry...forgot to say...I'm using Outlook 2003 Student and Teacher Edition on Windows XP. >-----Original Message----- >Whenever I go to Outlook Today, I get a runtime error, >line: 297 Error: Class Not Registered. Then I get the >error two more time...

Re: 'Uknown Error 0x800CCC97'
I just heard back from the folks with whom I filed this bug. They say the bug is fixed in cppop 5.4 - request that your ISP upgrade to that. -- Jeff Stephenson Outlook Development This posting is provided "AS IS" with no warranties, and confers no rights "Jeff Stephenson [MSFT]" <stephenson@online.microsoft.com> wrote in message news:... > See the attached reply to another similar question. Your ISP's POP3 server > has a bug, and they should get a fixed version of the server. > > -- > Jeff Stephenson > Outlook Development > This posting...

running reports from MS CRM prompt for username and password
Senario: When running a report from Microsoft CRM client it prompts for username and password. When given it's runs the report correct question: if MS CRM 3 is configured correctly is it normal that when trying to generate a report in MS CRM prompt for username and password? No, ideally it should pass the users AD credentials to the reporting IIS server (single sign on). If you were to close the browser and run a different report does it still prompt for credentials? I've noticed this does also depend on the hostname. For instance if the reporting server uses a differe...

stop error defeating me
Hi, XP Pro PC. When I start the computer I can start in safe mode but when I try to start in normal mode it loads to the log on screen. I type the username and password in then it starts to load but stops after a few moments with a blue screen. The error is Stop: c000021a (fatal system error) The windows subsystem system process terminated unexpectedly with a status of 0xc0000005 (0x7c9106c3 0x0055f36c). Begininning dump of physical memory. I have uninstalled AVG, also taken out the graphics card and uninstalled all the drivers for it. I have also changed the RAM. I have also d...

Error in database....
A user posted a batch in payables management. After posting, there was an error encountered. It displays that the table updating was interrupted, use batch recovery to continue the posting. But when I used the batch recovery, it was not successful to continue the update process. When I click the "More Details" button it displays, A save operation on table 'PM_Transaction_WORK' caused a sharing error. How can I resolve this issue? Thanks, John John, it is a db sharing violation. Have all users logout DELETE tempdb..DEX_LOCK DELETE tempd..DEX_SESSION DELETE dynami...

question about Time
How to make the time result for example if it�s ( 1:01 ) or higher shows only as ( 1:00 ) and if it�s Lower like ( 0:59 ) or less it will show the same result in this case ( 0:59 ) Any idea & suggestions. Thanks, almufadda@hotmail.com ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Using Ron deBruin's google addin and asking for subject round time, I get http://tinyurl.com/wgua -- Don Guillett SalesAid Software donaldb@281.com "saud" <saud.xgc4...

Time Clock Systems
Does anyone have a recommendation for a time clock system that integrates well with GP? On Oct 5, 10:20 am, kcd <k...@discussions.microsoft.com> wrote: > Does anyone have a recommendation for a time clock system that integrates > well with GP? We just implemented Time Matrix by Business Computers (www.business- computers.com) and are very happy with it. We implemented quickly the hardware wasn't propietary or complicated so we were able to source our own stuff. Troy I can speak highly of Unitime's time and attendance system. They are a relatively low cost solution t...

Short time vs short date
In my form I have a fldOutOfRoom which the user inputs a short time into the field, i.e, 0900. I have the following code in the open event of another form called frmRNnotes: If DateDiff("h", Forms!frmPtDemographicNew!frmVisitNewEdit.Form!OutOfRoom, Now) >= 1 Then Me.cmdRNnotesEdit.Visible = False This code gives the RN one hour to complete a note and then he/she can no longer edit the note. What I want to know is the Short Time format going to let the cmdRNnotesEdit button be visible everyday within one hour of the of the original time? That is, is the short time just a tim...

Some Excel formatting functions taking a long time to work #2
Excel 2000 SP3 When I use some formatting functions for the first time in a session, such as bold, increasing font size etc, it takes up to 30 seconds to work. Meantime Excel is locked up until it completes that formatting call. I suspect faulty DLL? Has anyone experienced this? How to fix (other than a complete re- install) ? Any advice appreciated. Piri On Nov 5, 8:39=A0am, Piri <wiremu.pare...@hotmail.com> wrote: > Excel 2000 SP3 > When I use some formatting functions for the first time in a > session, such as bold, increasing font size etc, it takes =A0up to 30 > secon...

Creating Text Box in Publisher 2007 Crashes the Application
Hello, we have a clean install of Publisher 2007 under Windows XP SP2, and when we try to create a text box in a document, (both an existing document and a blank document), publisher crashes. Office is fully patched. I ran Office Diagnostics from the help menu and no problems were found and the issue persists. Any thoughts on how to resolve the issue? Thanks, Syd See if selecting a different printer as default helps. How to view error signatures if an Office program experiences a serious error and quits http://support.microsoft.com/kb/289508/en-us -- Mary Sauer MSFT MVP http://of...

Outlook 2000 running on XP
After setting up a mail account and indicating that I want all passwords remembered I constantly get promoted to enter a password when I send and/or receive mail. I have clicked remember password in all dialoges during the setup process and via the Properties dialog following the creation of the account. Any thoughts or suggestions would be greatfully accepted Thanks "Ross Andrews" <anonymous@discussions.microsoft.com> wrote in message news:1fb4801c45886$24eab500$a301280a@phx.gbl... > After setting up a mail account and indicating that I > want all passwords reme...

error 553
The following error occurs when sending email from my business domain. It does not occur when sending through my roadrunner account. The following recipient(s) could not be reached: on 10/22/2003 2:05 PM 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) What does this mean and how can it be fixed? ...

Adding a word to the end of other words at the same time
I was wondering if there was a way to add a word to the end or beginning of multiple other words in Excel. Example; say I have these 3 words.... Alpha Beta Tera Now I want to add LLC to the end of each word but I want to change them all at the same time. Like Alpha LLC Beta LLC Tera LLC Is there a way to do that? Phil Its Excel 2003 try Sub addtexttoend() For Each c In Selection c.Value = c & " xxx" Next End Sub -- Don Guillett SalesAid Software donaldb@281.com "phil" <ptukey@charter.net> wrote in message news:1125340358.873337.4240@g44g2000cwa.googlegroup...

80070005 error #2
I am getting this error when trying to view public folder property from system manager. My issue is same as what you can find out from http://forums.msexchange.org/ultimatebb.cgi? ubb=get_topic;f=19;t=000114 Anyone has a clue? ...

MS Access 2007 code not running
I have created a brand new database in Access 2007 and linked some VB code to run on Form_Load. This code worked perfect with no problems the day I created it. Now today I opened the same form and it is not running the Form_Load code anymore (and yes it is still there, I did not delete it). I got frustrated so I copied and pasted the code to Form_Current and several On_Change events and set breakpoints at the beginning of all the events just to see if it was the Form_Load that was not triggering, but NO events are triggering my VB code. Any ideas? See this page: http://accessjunkie.com/fa...

what printers can run Vista
just purchased a dell which came with Vista on it. now my printer (HP 5550 deskjet) won't print. I need to find a new printer that i can hook up to the computer. This is an Access newsgroup. We help with questions related to Microsoft Access - the database application that is part of MS Office Professional. -- Rick B "monroe" <monroe@discussions.microsoft.com> wrote in message news:AC746826-251A-4097-AF88-2805BCDE7DEC@microsoft.com... > just purchased a dell which came with Vista on it. now my printer (HP > 5550 > deskjet) won't print. I need to...

Recommendations Please: Software That Can Backup Outlook While It is Open/Running
As the subject says. There are lots of packages that will backup the pst, etc. once Outloook is closed, but some products claim to do it while Outlook is open. Any suggestions on products that actually do this and do it properly? If the product can safely backup over the network to a server and can do incremental/update backups throughout the day, I'd really like to hear about it. Thanks. ...

SQL 2008 running on a VM using all allocated memory
Hi, I've got a sql2008 server running on a VM. There's 9GB of physical RAM, which 7GB have been allocated to SQL Server. But when i look at task manager, i see that the SQL server is actually using all 7GB, which is pegging the memory usage of the overal box at above 90% used. We're mostly a sql2005 shop, and none of those servers are doing this. I have sql2005 running on VM's, someone actual servers as a named or default instance, and some even clustered. None of them have this problem. Is this a normal thing with sql2008 only? Any insight would be greatly appre...

DLLs being loaded for all applications
I get the following warning at system startup: "Custom dynamic link libraries are being loaded for every application. The system administrator should review the list of libraries to ensure they are related to trusted applications." How do I review the list of libraries and how do I eliminate any that should be removed? ...

Sending E-mails at a defined time with MS Exchange Server
We're using MS Exchange Server at the office. We have around 150 e-mail accounts set up. Some of our users are sending enourmous attachement (~100 Mega) and sometimes to 50 different addresses. During the day this is chewing up all our bandwith. What we would like to know if it's possible in Exchange to define that sort of rule : - Send e-mails with an attachment bigger than 8 M�g only after 20h00 ? (so they don't chew up the bandwith during the day as this has an impact on our FTP transmission module and our client server applications) Or maybe an add-on ? Any suggestions...

Windows 7/IE8 Javascript will not run.
I am having major issues with IE8 recently. I get no error messages, things just don't work. For example, I can't download files from sites, windows update will not download files either. I viewed the html source on a particular page that wasn't working and there was some text in the html that said Javascript was not supported in my browser (but the text didn't show on the screen). FWIW, I have now installed both chrome and firefox and they don't have any problems with javascript or download files, etc. This problem started after I switched from McAfee to...

CRM Error
Hello When a user replies to an CRM email, clicks the "reply" button or the "reply all" button, clicks in the body of the email message and clicks "insert template", this error appears. This does not happen every time, and happens to various users. Does anyone know why we would get this error? ...

Out of Office
I have a problem when I try to set up my "out of office" message. I use Outlook 2003 and have XP Professional. I do not have an exchange server so I have to emulate it - which I did. So.........when I leave for vacation, I have to leave my computer on and Outlook running to have the "Out of Office" message sent to any incoming emails. This seems crazy to me. I run a small business from my home - so what happens if the power goes off on the first day of vacation - then I have no out of office message going to clients. Is there any way around this?? Thanks in a...