+ Reply to Thread
Results 1 to 2 of 2

Macro works on some computers but on others it doesn't

  1. #1
    Registered User
    Join Date
    12-12-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    8

    Macro works on some computers but on others it doesn't

    I have many this extensive vba coding that works on 2 computers but not on others.

    In this part of the code it gives me errors in the Set originsheet, set wkbkdest and set destsheet lines

    Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim wkbkorigin As String
    Dim wkbkdest As Workbook
    Dim originsheet As Worksheet
    Dim destsheet As Worksheet

    wkbkorigin = ActiveWorkbook.Path & "\ABC"
    Workbooks.Open Filename:=ActiveWorkbook.Path & "\ABC.xls"

    Set originsheet = Workbooks("ABC").Worksheets("Sheet1")
    Set wkbkdest = Workbooks("DEF")
    Set destsheet = Workbooks("DEF").Worksheets("Autofill")

    .
    .
    .

    and also getting an error on other computers when I want to display an array that i've previously filled with data, into a range in a column

    Set R = wkbkdest.Worksheets("Sheet3").Range("A1").Resize(UBound(strarray) + 1, 1)
    R = Application.Transpose(strarray)

    (I'm making the program for another computer)

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Macro works on some computers but on others it doesn't

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here


    I'd also suggest that you provide a sample workbook with some typical data.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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