Application-defined or object-defined error


I find myself stumped by an incredibly easy piece of code and one that I
have used before.

I am getting the error:
Run-time error '1004':
Application-defined or object-defined error

I am getting the error when I run the following code:

Private Sub Workbook_Open()

With Application
    .ScreenUpdating = False
    .DisplayAlerts = False

    Workbooks("HighHoldTimesDetailed.xls").Worksheets("data").Cells.Copy _
    'error happens on above line(multi line)

    Workbooks("HighHoldTimesDetailed.xls").Close False
    .ScreenUpdating = True
    .DisplayAlerts = True
    .ActiveWorkbook.Saved = True
End With

Worksheets("Team Graphs - Combined").Activate

End Sub

This runs when the file opens.  The point of it is to copy a worksheet from 
one file into the current file.

It opens the source file ok but chokes on the actual copy command. I do not 
understand why.  I have used the above lines of code many many times in many 
files to copy worksheets from one workbook to another and have never had a 
problem before.

The only difference than before is the location of the source file, normally 
when I run this set of commands the source and destination files are in the 
same directory. But the code opened the source file ok, so I do not think it 
is that.

Also - I know the source file has a lot of data on the worksheet "data".

Is there something obvious I messed up here? Some blatant typo?

Thanks in advance for another set of eyes!


9/8/2006 5:28:18 PM
excel 39880 articles. 2 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 0


I'd guess that you need to tell Excel where the destination file is
stored, otherwise it'll be looking in the same directory as the source.



9/11/2006 10:12:17 AM

Similar Artilces:

Unknown Error
Anyone have any idea why I can't delete a message in a Junk folder? I'm getting a plain/simple dialog box saying "Unknown Error" and the message will not delete. Trying to move it to the Inbox, for example, returns a dialog box message saying "Can't move the items. The item could be moved. It was either already moved or deleted, or access was denied." Any ideas? Thanks, Tom Robbins On Wed, 29 Nov 2006 09:14:44 -0500, "Exchange Groups" <> wrote: >Anyone have any idea why I can't delete a...

Clicking one application's buttons from another application
Hello, I'd like to write an application that can click the buttons of another application running on the same machine. All my application knows about the target application is its name, the name of the window containing the buttons, and the name of the buttons. Can someone further my education in this matter in some way. Thanks, Ray Mitchell This is tricky, but possible. I actually do it in a little utility I wrote to move Outlook filters down, since the "Move Down" button doesn't autorepeat and when you have 850 anti-spam filters it becomes a bit unwieldy. What yo...

Bizarre Reports Error
For Some Unknow Reason all my reports are playing up, when i open any report now, it looks like its zoomed x1000 in the Left Top Report Header, Tried zooming out and nothing, the report just gets smaller. the only way i seem to cure this is when i click setup on the report preview and then go columns tab change some thing, change it back click apply and OK then the report Is correctly displaying its self, and im having to do this every time i open a report. any one know whats causing it? On 28 Aug, 19:06, Maurice <> wrote: > Have you tried sett...

running another application from my application
Hello, I have an MDI application that on a specific case runs a 3rd party application. I use PeekMessage so my application will be drawn corretly while working on the 3rd party app. I want to prevent the user from doing anything in my application while te 3rd party app is running, until the user closes the 3rd party application. Also I want my application to be shown correctly (handle WM_PAINT, WM_DRAW etc.). Currently my application is displayed very well, but the user may do things in my application while the 3rd party app is running. I use the following code (pseuo): BOOL bRetVal = CreateP...

SMTP Protocol 7004 & 7002 Error
I have Exchange server 2003 with sp1, an my event logs a filling with errors 7004 or 7002, How should I interpreted those results : IP are external IP: Event Type: Error Event Source: MSExchangeTransport Event Category: SMTP Protocol Event ID: 7004 Date: 02.10.2005 Time: 19:23:31 User: N/A Computer: HIS10 Description: This is an SMTP protocol error log for virtual server ID 1, connection #21. The remote host "", responded to the SMTP command "rcpt" with "550 Requested action not taken: mailbox unavailable ". The full command sent was "RCPT...

Application exiting with return Code 3 and ExitInstance not called neither destructors
Hey Friends It seems that i have done something very mysterious as my Application is exiting with return Code 3 and ExitInstance is not not called neither destructors. Plz Help "Vikrant_kpr" <> wrote in message > Hey Friends > It seems that i have done something very mysterious as my Application > is exiting with return Code 3 and ExitInstance is not not called > neither access violation? Dear Antonio Mazzeo I have corrected the problem,it was causing due to Splash Screen Compone...

Microsoft Visual C++ Runtime error
Hi, the first time I log into Outlook each day I get "Microsoft Visual C++ Runtime library/Run time error" message pop up. It also states "C:\Programs\Office\Outlook.exe" and the text says "Application required the runtime to terminate it in an unusual way". When you "OK" it then log back in, all is fine. Anyone have any ideas how to rid myself of this annoying feature? Thanks Chris Hi, (I'm on XP), Outlook 2000-SP3 - I figured out when it happens - I have two identities set up on my machine. If one identity has outlook open, then I s...

Ideas for a Dept Level Application Support
We have an IT group that supports 50 applications and they wish to capture support time by application during course of the year. During the course of a week, any application or combination of applications can have support requests, so it is different week to week and not predictable. Essentially we are looking to park the time with appropriate application after the work is complete. We are using Project Server 2007 and have investigated the following: 1. Created a Annual Support workplan with a task per application in Project Pro with the IT group added as Enterprise resourc...

Error: "Duplicate Record A record of this type with this name already exists"
I have a strange error that started today. (I am Using V1.2) When I try to convert a lead to an account AND a contact I get the following msg: "Duplicate Record A record of this type with this name already exists. Please choose a different name and try again" At the end of the process the program is crating an Account record but not a contact record. If I try to convert the same lead again to a Contact I get the same msg. Converting a lead to an Account or Contact ONLY will work fine. The following is error is registered on the server Application log: Event Type: Error Event Sou...

Help in creating dialog based application
Hi, I am creating a dialog based application which has a main dialog with 3 buttons. 1. Address Book 2. Student List 3. Course List with which i can go to any one of the screens(which is again the dialog). when i click address book button my main dialog should be hidden/closed and i should open the address book dialog which has again some button to navigate back to main dialog/student list/course list. same kind of functionality for other two dialogs(student/course list). i thought of creating all the 3 dialogs as modeless and main dialog as parent but how i will inform the parent window to ...

Trigger error
I have a delete trigger that is trying to get information during the delete using the deleted object and I am getting the errors below. The multi-part identifier "deleted.RepCompanyID" could not be bound. The multi-part identifier "deleted.BrandID" could not be bound. The trigger code giving the error is below. p.s. This is from an old database so alternatives in constraint use would be ok. Thanks. DECLARE @RepCompany varchar(200); DECLARE @Brand nvarchar(50); DECLARE @OldInfo varchar(200); SET @RepCompany = (SELECT RepCompany FROM dbo.Rep...

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? ...

persistent error for altered or nonexistent line
When I am getting a persistent error (in an imported C header), even when the particular line has been commented out, edited or even removed, where is the error coming from, and how can I flush it? c:\hand in hand\test\vorbisfile.h(27) : fatal error C1083: Cannot open include file: 'codec.h': No such file or directory "Steve Russell" <> wrote in message news:OKDr%23BFdFHA.2180@TK2MSFTNGP12.phx.gbl... > When I am getting a persistent error (in an imported C header), even when > the particular line has been commented out, edi...

DCOM Error 10009
I have a small peer to peer network. One of the machines (XP Pro SP3) recently started to log DCOM Error 10009 every time Windows boots. There is a failure event for each machine on the network. The text of the message is: DCOM was unable to communicate with the computer COMPUTER NAME using any of the configured protocols. This is the only machine doing this, and as I mentioned it just started a few weeks ago. Nothing has changed or been installed on the system. There is no spyware or Viruses on this machine. I have removed all mapped drives and printers. Does the machi...

No Error Message in XP
Hello, I have a macro that hides some columns based on a selection from a validation list. The original spreadsheet was developed in Excel XP; I created the code in Excel 2000 because at the time I didn't realize the programmer had done the spreadsheet in XP. I ran and checked the macro which was not working, but I did not get an error in XP. I switched over to 2000, ran the macro, got an error, and because of the error message then figured out what was wrong with it. My point to this whole rambling explanation is, does anyone know why I would not get the error in XP? The er...

Dear all, I tried Installing CRM 4.0 professional edition in my test lab on windows server 2003 sp2, i keep receiving the following errors after folloming the implementation guide step by step: 1.error: verify domain user account SPN for microsoft dynamics CRM ASP.NET application pool account.( I use domain user account with domain admins right for the service account) 2. Error: Index was outside the bound of the array 3: SQL error: an error accured while esterblishing connection to the server, when connecting to SQL server 2005. This failure may be caused by the fact that under defa...

Converting Console Application to win32 application
I have created an MFC console application. When I run it from Windows Explorer it opens a dos box and closes the box when it terminates it logic. Is it possible to convert it so it won't open the dos box - just run without any display? If positive, please help me regarding the steps. Thanks Kalish I am not sure if you can compile MFC with a standard win32 application, but if you can, then you can simply change your main to a WinMain, and you will have the result you want. Create a Win32 Project using the Wizard, and selection Windows Application, to see an example. Remove everthing ...

is there a hotel management excel application?
The subject says is all... TIA Martyn Hi Martyn, See response to your thread in Programming. --- Regards, Norman "Cheker" <> wrote in message news:eNJLsRRqEHA.348@TK2MSFTNGP15.phx.gbl... > The subject says is all... > TIA > Martyn > > > ...

Microsoft Error
I bought a powerbook g4 about 7 months ago along with MS office 2004. When I installed it the first time...I had a bit of trouble because of the test drive thing...then I uninstalled that. MS office went back to working perfectly. Then, literally all of a sudden, I would click a word document off the desktop or try to open MS word program and I get this error message. The error message says "Microsoft Error Reporting....MS Word has encountered a problem...blah blah blah..." So, silly me, I uninstalled it...figuring that maybe I should reinstall later. I did that and to no avail t...

MSMQ ... authenticating application
A number of application stores messages in MSMQ. One of the server application needs to read messages that was created/stored by specific applications not to read all the messages in MSMQ. Is there any workarounds? Thank you Regards Raj "Raj" <> wrote in message >A number of application stores messages in MSMQ. One of the server > application needs to read messages that was created/stored by specific > applications not to read all the messages in MSMQ. > ...

Is there any way to detect when an application that is calling my dll is about to be destroyed? I need to close several files if the calling application has not done so, therefore I need to detect when the calling application is about to be destroyed and clean up the files and variables I have used in the dll. You need to implement DllMain, the handle your cleanup tasks when you receive a PROCESS_DETACH notification. Check out: "Joe Estock" <jestock@NOSPAMnutexto...

ERROR saving Grid as XML
SCENARIO ======================================= I have a Grid and I want to save the values on an XML. Let me say that I am NOT using DataSet to load valus on my grid. PROBLEM ======================================= When I am saving a Grid to XML I get the following exception: "Token StartElement in state Epilog would result in an invalid XML document" SOURCE CODE ======================================= myXmlTextWriter = new XmlTextWriter (aFileName, null); myXmlTextWriter.Formatting = Formatting.Indented; myXmlTextWriter.WriteStartDocument(); myXmlTextWriter.WriteStartElem...

when replicating, I get error message, but there is no table
when replicating with my assistant, I get that there are replication errors, but when I try to open the conflicts table, I get that there are "no conflict tables" =?Utf-8?B?YmttNGVhZ2xl?= <> wrote in > when replicating with my assistant, I get that there are > replication errors, but when I try to open the conflicts table, I > get that there are "no conflict tables" You'll have to look at the tables directly. The conflict tables are called BaseTabl...

Pivot Table Error Message
I received the following message when dragging my "Products" item onto my Pivot Table. "A field in your source data has more unique items than can be used in a Pivot Table." I have 14,802 unique Product items. Does anyone know what the limitation is AND how to get around it? The following MSKB article outlines the PivotTable limits in Excel 2002, and has links to articles on other versions: XL2000: Limits of PivotTables in Microsoft Excel 2000 XL2002: Limits of PivotTables in Microsoft Excel 2002 http://supp...

MFC applications and Visual C++'s newer editions
Hello. When it comes to Win32, Visual Studio .NET 2005 Express Edition Beta 2 only allows the creation of console-based applications. What if one wanted to create MFC-based applications and, at the same time, be able to take advantage of the powerful and conforming C++ compiler that comes with the package? I hope that resorting to Visual C++ 6.0 is not the only option. Thank you, -- Ney Andr� de Mello Zunino "Ney Andr� de Mello Zunino" <> wrote in message news:%23FuRyAcXFHA.584@TK2MSFTNGP15.phx.gbl... > Hello. > > When it comes to Win32, Vi...