+ Reply to Thread
Results 1 to 12 of 12

macro working on one not another computer

  1. #1
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    macro working on one not another computer

    Hey all,

    I have 2 laptops, both from work and setup by work IT. This means they should both be installed similar, with same push updates etc. On the second laptop, several macros wont run, one simple one is like follows:
    Please Login or Register  to view this content.
    I stoppes at what is set to bold "ActiveSheets.Picture.Paste.Select". I checked a third computer, and it worked there. So just 1 where it wont, which offcourse is the one I am working on (it's a shared machine, so I can't just switch to one of the others). I have checked security settings, and all seems ok.

    Hope someone has any suggestion. I read about copying everthing to a new sheet, but it's a huge file and hope there is a quick fix somehow...

    Cheers!
    Last edited by tigergutt; 03-07-2018 at 05:39 PM.
    kind regards
    tigergutt

  2. #2
    Valued Forum Contributor
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    921

    Re: macro working on one not another computer

    I am surprised that it does not error on all the computers. 'ActiveSheets' is an invalid object. It should be singular 'ActiveSheet'. Better yet, Use the Sheet code name 'Sheet5', or the tab name eg. Sheets("Sheet5") or Sheets("Data"), etc.
    Last edited by JLGWhiz; 03-07-2018 at 06:20 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel.

  3. #3
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: macro working on one not another computer

    first thanks for you reply.

    Second, not sure where the "s" came from, must have type inn by accident.
    For some strange reason, changing from "activeSheet" to Sheet5, the macro ran as it should, using sheets("tapname") did not and got the same error...

    I'm curious as to why sheet5 worked, I tried a 4th machine and the original macro ran there too. So seems to be a little hit or miss if the my PC/laptop will accept activesheet or not as a command?

  4. #4
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: macro working on one not another computer

    Sorry to tell you but the problems is back...
    No idea what's happening, but not nothing works now and the macro stops at the same point again...
    I went back to my backup file, and redid what worked earlier, but no luck this time. Tried all 3 different options and same error each time.

    Googling I see this is a common problem, seems to be happening on larger sheets that are worked on over many years and possibly different excel versions. I guess we just have to rebuild the whole lot...

  5. #5
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: macro working on one not another computer

    if it helps, the error I get is as follows:

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

  6. #6
    Valued Forum Contributor
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    921

    Re: macro working on one not another computer

    Quote Originally Posted by tigergutt View Post
    if it helps, the error I get is as follows:

    Run-time error '438':
    Object doesn't support this property or method...
    It certainly helps to know what the error is, and if you click the debug button when you get those errors, it will show you the line of code that the error occurred on and you can pass that along to us also.

    The reason the Sheet5 worked and the others didn't is because sheet5 is the sheet that was last activated. If you put another sheet name there, the all the references before that line which apply to sheet5 are invalid for that line to process. If you take the time to read the code as it is written and not think of it as a cryptogram, you can probably understand what it is doing. VBA is almost like writing in English, unless the coder is using the values of the constants instead of the VBA language.

    I took a quick look to see if I could figure out which line the error might have occured on but it is late here and I am tired and it was not obvious to me. So if you can post that information, I will take a look at it tomorrow.

  7. #7
    Valued Forum Contributor
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    921

    Re: macro working on one not another computer

    I decided to give it a shot before retiring. See if this will run without the error.
    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 03-07-2018 at 11:30 PM.

  8. #8
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: macro working on one not another computer

    Hey,

    Thanks for the suggestion, but I get the same error.

    Also, apologies for not being clear enough, but the code stops at picture.paste, in both original code and yours. (I tried highlighting in bold, but it isn't very visible, sorry )

    Hope you had a good rest, and thanks again.

    Cheers.

  9. #9
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    1,075

    Re: macro working on one not another computer

    Why not copy picture
    Please Login or Register  to view this content.
    Last edited by daboho; 03-08-2018 at 12:31 AM.
    "Dont Forget Click SOLVED_You can show your appreciation by clicking the Add Reputation * at the bottom left of any of their posts"

  10. #10
    Valued Forum Contributor
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    921

    Re: macro working on one not another computer

    Try removing the word 'Picture'. Excel should know what it has on the clipboard.

    Please Login or Register  to view this content.
    Or try @daboho suggestion. I am not that familiar with copying images with Excel, so my syntax could be in error.

  11. #11
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: macro working on one not another computer

    Hey daboho,

    Took me 5mins to understand where to paste inn you suggestion, but so far it seems to have solved it. WhoopWhoop
    I've got 3-4 hours until I need to start on my report, and will test on this update with actual data.

    Thanks a bunch, you too @JLGWhiz for your time and suggestions! Always appreciative for the kindness on this forum!

  12. #12
    Valued Forum Contributor
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    921

    Re: macro working on one not another computer

    Happy to help. I did a little brushing up and learned something too. thanks for the rep.
    Regards, JLG

+ 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