+ Reply to Thread
Results 1 to 7 of 7

error 40351 on one machine but not other

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252

    error 40351 on one machine but not other

    I am running the following code
    Please Login or Register  to view this content.
    and this code is being accessed through a network drive by putting a shortcut in the XLSTART folder of two different machines. The problem is that I get the following error
    Run-time error ‘40351’:
    Application-defined or object-defined error
    on one machine and not on the other. I'm trying to figure out why. The error procedes to highlight this line of code
    Please Login or Register  to view this content.
    Any suggestions?
    Last edited by DKY; 10-06-2008 at 01:31 PM.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Try running it in debug. Or, put a line before it to print to the Immediate window:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252
    Okay, I'm not sure how to run in debug mode but I stepped through the program with the F8 and put that line of code in there. I hit ctrl+G to display some window called "intermediate" and it showed me the value for "Range(strletter & i)" on both my machine and the machine having troubles. The only difference is that the machine having troubles still stopped on the line that says
    Please Login or Register  to view this content.
    and gave me
    Run-time error ‘40351’:
    Application-defined or object-defined error
    Whereas with mine the program runs beautifully.

    Oh and P.S. that 'Solved' thing still doesn't show up and I started this topic today. LOL! Oh well.

  4. #4
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    I would recommend verifying what values your variables hold:

    Please Login or Register  to view this content.
    When you hit debug, hover your mouse over 'strletter' and 'i' to see what value they are when it errors.

    Then go to the computer where it works, and mark the line directly after this line to go into debug mode. Then hover over both values again to see what they are when it works correctly.

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Set Access Visible to True and insert an Exit Sub befor the loop. Did Access open? You may need to check the Task Manager.

    If it opened, the user could open the file file. Using a UNC path, you may have a permissions issue.

  6. #6
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252
    Yawnzzzz
    They end up having the same (correct) values on both machines.

    Kenneth
    For some reason I do see the database opening when I run it on both machines regardless of the Access Visible (actually I was trying to figure out how to not see the database opening and hadn't gotten that far yet). So I know that the database is opening. I was wondering if there was an issue with the 'objAccess' part of the code. I don't know what the issue could be but I just couldn't think of anything else. What kind of set up do I have that someone else doesn't. Do you think that there's possibly a permission issue on the database itself?

    Other forums I've posted this question at:
    http://www.mrexcel.com/forum/showthread.php?t=345011

  7. #7
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252
    The answer is always so easy, isn't it? I just figured this out. The reason it's not working on other machines is because the other machines are set up to block macros when they open Access. I set them up to allow macros and it works like a charm, thanks for the help all.

    I may take some time and look into the digital signature thing but haven't quite made up my mind yet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How can i do a frequency distribution by machine automatically?
    By c1steady in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-15-2008, 01:21 AM
  2. machine monitoring
    By ace323 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2008, 06:21 AM
  3. kill workbook if not opened on a certain machine
    By inwalkedbud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2008, 03:59 AM
  4. vb auto data sort when entry 2 cell
    By n_caskey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2008, 10:13 AM
  5. Remote Server Machine does not exist error
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2007, 03:11 PM

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