+ Reply to Thread
Results 1 to 22 of 22

Run-time error '438': Object doesn't support this property or method

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Run-time error '438': Object doesn't support this property or method

    When I run the program, I get a message saying the following.:
    Run-time error '438':
    Object doesn't support this property or method
    When I click "Debug", I get the following line highlighted.:
    Please Login or Register  to view this content.
    Here is the full code.:
    Please Login or Register  to view this content.
    How do I fix whatever is causing this error?

    If more information is needed or if I can somehow make it simpler for you guys to help, just tell me what to do.

    Any help would be greatly appreciated as always!

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Run-time error '438': Object doesn't support this property or method

    what is the_larger_file.xlsm ? is it an open wb ?
    try
    set wsSrc = Workbooks("the_larger_file.xlsm").WorkSheets(1)
    Last edited by patel45; 11-13-2012 at 12:51 PM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    I modified that part of my syntax before pasting the code here. Is that what you meant?

    Edit: Yes, there are two workbook's open. "This" workbook/file (where the macro is) and the "other"="larger" workbook/file.
    Last edited by s3a; 11-13-2012 at 01:33 PM.

  4. #4
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    I added the "Set" syntax in front of wsSrc, wsDest1, and wsDest2 and now I get the same error
    Run-time error '438':
    Object doesn't support this property or method
    and when I click "Debug" the following now gets highlighted.:
    Please Login or Register  to view this content.
    Edit: This problem persists whether I put "Set" in front of lastColumnDest or not. Should I not put "Set" in front or should I but I also need to do something else?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Run-time error '438': Object doesn't support this property or method

    Cell should be Cells.
    If posting code please use code tags, see here.

  6. #6
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Here is the latest macro code.:
    Please Login or Register  to view this content.
    I changed all "Cell" occurrences with "Cells" and now when I try to run the code, I get the following message.:
    Run-time error '424':
    Object required
    and when I click "Debug" the following line is highlighted.:
    Please Login or Register  to view this content.
    What's currently wrong with the code?
    Last edited by s3a; 11-13-2012 at 06:08 PM.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Run-time error '438': Object doesn't support this property or method

    Without a workbook to run the code on it's hard to tell why you get that error.

    Perhaps you could attach a sample workbook?

  8. #8
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Can I send it to you via a private message or something?

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Run-time error '438': Object doesn't support this property or method

    You can attach it here without any sensitive data.

  10. #10
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Okay, I modified them to not have sensitive data.

    For "ThisWorkbook_no_sensitive_data.xlsm", the names are just examples as in the file should take the names from "OtherWorkbook_no_sensitive_data.xlsm" from an initially name-less "ThisWorkbook_no_sensitive_data.xlsm".

    If you have any questions, ask me and I will answer them.
    Attached Files Attached Files

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Run-time error '438': Object doesn't support this property or method

    You have wDest instead of wsDest.

  12. #12
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Oops. Thanks for catching that.

    I've done a few more minor modifications to the macro and here it is.:
    Please Login or Register  to view this content.
    When I try to run it, I get a message saying the following.:
    Run-time error '1004':
    Application-defined or object-defined error
    and then when I click "Debug", the following line is highlighted.:
    Please Login or Register  to view this content.
    I don't see any typos here so the issue must be something else. Commenting the line causing the problem makes the next logical line be the problem so that further reinforces my belief that it's not a typo but I'm still not sure.

    Edit: I fixed a minor, unrelated issue and, I updated the code in this post (and the problem still exists).
    Last edited by s3a; 11-13-2012 at 05:31 PM.

  13. #13
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    I found this link ( http://www.mrexcel.com/forum/excel-q...ned-error.html ) which suggested that the name of the file I'm using would be wrong but I re-copied and pasted it just to make sure and it's not the problem.

    Is my issue related at all?

  14. #14
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    I also tried the following stuff and still failed to fix this most-recent problem.:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    07-27-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007/2010
    Posts
    86

    Re: Run-time error '438': Object doesn't support this property or method

    either one of them is 0. Therefore, you can't refer to cells(0,1).
    Boon

  16. #16
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Okay so, does that means that my initial syntax was right and that I need to find a problem with the code's logic such that the row parameter is 0?

  17. #17
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    I added a firstRowDest value in the second sheet of the destination workbook and now initialize the variable using it as follows.:
    Please Login or Register  to view this content.
    This brought me to another issue (I'm really sorry about this) where the error is:
    Run-time error:
    Object doesn't support this property or method.
    and clicking "Debug" highlights:
    Please Login or Register  to view this content.
    Nothing seems to be 0 to me. So what could be wrong now?

    A potentially interesting thing to note is that commenting
    Please Login or Register  to view this content.
    causes the program to run successfully but hang indefinitely (or so it seems).

    If I haven't provided enough information, tell me to and I will.

    Edit: Here is the most up-to-date code.:
    Please Login or Register  to view this content.
    Last edited by s3a; 11-13-2012 at 07:27 PM.

  18. #18
    Registered User
    Join Date
    07-27-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007/2010
    Posts
    86

    Re: Run-time error '438': Object doesn't support this property or method

    Please Login or Register  to view this content.
    Cell(currentRowSrc, 11) should be Cells(currentRowSrc, 11)

  19. #19
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Thanks again.

    After more modifications, I now have the following code which runs without a problem but just hangs indefinitely.:
    Please Login or Register  to view this content.
    Like I said, when I run it, it hangs indefinitely however, when I click to close it and then tell Windows to restart the program, it says:
    Run-time error '-2147417848 (80010108):
    Method 'Copy' of object 'Range' failed.
    When I click "Debug", it highlights the following line.:
    Please Login or Register  to view this content.
    Is there something wrong at all or does VBA take really long to work on three to four thousand cells and the error just arises because I cancelled the operation?

    Edit: I am attaching the Excel workbooks (with no sensitive data) with the latest macro in it in case someone is reading this post for the first time (or for whichever convenience).
    Attached Files Attached Files
    Last edited by s3a; 11-13-2012 at 11:52 PM.

  20. #20
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    What, in words, is the code meant to do?

  21. #21
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Running the macro should interpret data from the larger excel file/workbook and then transfer that interpretation to the smaller Excel file/workbook. The smaller file should eventually become larger than the currently larger file but I'll call "This workbook" or "the smaller file" since I'm referring to their state before the macro's first fully successful run.

    What I mean by "interpretation", if it's not clear, is that although in some cases, data can be simply copied and pasted, in other cases, the destination data might be different (but based off of) the source data. For example, "this workbook" should look at the larger file and find out the hours someone is working (where the name of the person or another name but let's always consider it to be the name of the person) and put a W at every intersection of the time worked and the name of the person working. If the person doesn't work at a certain time/date, nothing will be put. Any letter other than W is to be put manually (without the use of the macro).

    "This workbook" should be empty before the macro is run as of row 2 and below as well as have no names to the right of S&P, Loto Quebec, and Project.

    For now, there is nothing to do in "this workbook" for "Resources required".

    Date and Day should be copy/pasted. For every one row in the larger file, there needs to be 36 columns in the smaller file (from 6:00 AM to midnight).

    The times are to be interpreted as the union (in math terminology) of "Reg Start" (column L in larger file) and "Reg End" (column M in larger file) as well as "Inst Start" (Column T in larger file) and "Inst End" (Column U in larger file).

    Plan, Work, Flag, Sick, Vac, Training each don't need to be dealth with using the macro (since they use excel formulas or whatever the terminology is - the point is they change dynamically too and without a macro's help).

    Everything on the right of "Project" is to be added there manually (without the help of the macro).

    If skill is "LQ" in the larger file, the name of the person should go to the right of "Loto Quebec" in "this workbook". If it's anything else including S&P in the larger file, it should go in S&P in "this workbook".

    Also, I would like for the process every time the macro is run to continue from the column after the last one processed in the larger file rather than going through the thousands of columns again (unnecessarily) and freezing the window (as well as taking long).

    Hopefully, I didn't leave something out. If I find that I remember something I didn't say here, I will add it later.

    If more information is needed, just ask.

  22. #22
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Run-time error '438': Object doesn't support this property or method

    Seeing as how the thread no longer reflects the post of the title, I will be marking this as solved and continuing the question anew from the following link.: http://www.excelforum.com/excel-prog...85#post3009385

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1