Results 1 to 14 of 14
  1. #1
    suttilld is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14

    Runtime error only in Runtime Environment: Object Variable or With block not set

    Hi, I am developing an Access DB that imports and exports contacts to Outlook. It runs fine on my laptop which has full access installed, but when I try to run it on a laptop that only has Access Runtime environment, I get a Runtime Error "Object Variable or With Block not set". I have narrowed it down to these lines:

    Set item = oDialog.Recipients.item(1).AddressEntry.GetContact
    Contact.varFirstName = item.FirstName

    The second line "item.FirstName" throws up the error, so the previous line must not be working properly. Why would it work in a full Access install but not on Runtime?


    Thanks, any help much appreciated.

  2. #2
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    the first thing I believe visual basic developers go to for this error is checking if there is no accompanying library that's needed for the app to run.

    I'm inclined to think that the GetContact action doesn't get anything because data is not there. if the code line executes fine, more than likely that's what happening I would think. but that shows the crappiness of visual basic, if you want this man's opinion! why would you be allowed to initialize anything if the action does give you what you need?

    I've never used GetContact....what data is it supposed to be getting?

    to debug, I would recommend hovering the mouse over the vars on a user-break to get the data at that execution point. or you can always set a watch on a variable and look in the window when you're in the modules scope. there are plenty things you can do to debug...

  3. #3
    suttilld is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    What happens just before this, is SelectNamesDialog is displayed to the user to allow them to select an outlook contact. This returns a Recipient object which contains the name of the contact they selected. The GetContact function then returns a ContactItem object containing the contact details that relate to the recipient the user selected.

    The problem is not so much that it doesn't work. It works fine on my laptop with a full access install. But on a laptop with only the Acccess Runtime Environment it throws up the error. The problem is you can't debug code in the runtime environment, or at least I think you can't. I had to track it to these lines by commenting everything out until it failed. Very boring.

    Anyway, these outlook functions need the Outlook Object Library referenced to run, which is fine, but I don't think that's an issue, because it runs code from those libraries fine elsewhere in the code on both laptops.

  4. #4
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    wow. well you obviously know what you're talking about. and now that I read your last post, I don't think much of mine made sense. not sure what planet I was on...

    I guess the only thing I can think of to help out is: maybe allow the user to specify the contact information in the acc file, then just point to it and do what you need using the pointer only? that would be an option, but probably a code change.

    other than that, I think it's up to you to debug. don't forget about other differences between the computers though, that might be secret culprits!

    sorry...good luck with it!

  5. #5
    suttilld is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    Oh well, thanks anyway, I'll keep bashing away at it. I'm going to try a clean install of Windows and Access Runtime on a VM machine. Hopefully that will remove any interference from other differences. I've also noticed that certain MS generated code causes runtime errors in the Runtime Environment as well, and the error handling doesn't event catch them! Great, fills me with confidence!

  6. #6
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    Quote Originally Posted by suttilld View Post
    Oh well, thanks anyway, I'll keep bashing away at it. I'm going to try a clean install of Windows and Access Runtime on a VM machine. Hopefully that will remove any interference from other differences. I've also noticed that certain MS generated code causes runtime errors in the Runtime Environment as well, and the error handling doesn't event catch them! Great, fills me with confidence!
    I may have advice on this, if you're still listening....are you in small business? freelancer? I would strongly discourage using any MS software that is not .NET-related. just from experience. have you considered OS software as well? there is some really good stuff out there.

    unfortunately though, OS software is sometimes accompanied with really intricate syntax. like PHP for instance. if you look at the coding for any of the php blogging software like drupal, joomla, wordpress, etc..., it's a lot different than reading basic.

  7. #7
    suttilld is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    Unfortunately I'm only a dabbler I have developed in C++ in the past, lets see 10 years ago, is it that long, groan! But I'm only doing this as a favour for a friend, and wouldn't know where to start with setting up the frameworks to develop in those languages you mentioned. Access is a good framework, in that it gets you up and running quickly, but it can get a bit tedious when it doesn't work. Thanks.

  8. #8
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    yes it can. i wasn't giving you direction. you do realize too don't you, that .NET languages are virtually the same thing all rolled into a single effort by MS to thwart off competitors? but at any rate, i have visual basic and C# ok, but C++ I wouldn't mind having a teacher for! although it isn't much a migration itself either.

    I only mentioned .NET because MS pays a heck of a lot more attention to that than they do to office products. they probably put their newbies on the office software maintenance.

  9. #9
    suttilld is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    No that's cool. I probably should grow up and stop using VBA. What do you use to develop .NET, is it Visual Studio?

  10. #10
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    yes...I've always thought that microsoft deploys absolute crap but in the employment market around me there's not much java or OS to be found. thus, you're stuck with .NET.

    I am technically a developer, but my interests lie more with research on underground activities and hacking methods used to compromise networks. I did read that the recent compromise with eHarmony and LinkedIn was related to a worming technique that the Russian hacker used. haven't read much about it though. although I did read that, apparently in this day in age, salting password hashes is "Security 101". that's what CNBC says anyway. that's the first time I've ever read something of the sort. but I guess it's about time...if I'm not mistaken the NSA is in the process of picking the winning candidate for creating SHA3.

    for pet projects I use 2010 express, which is free in its different forms. vb, c++,c#,vwd. otherwise I use what the employer has. not much other choice.

    in my eyes there's nothing wrong with vba, but the fact is that it's crap (and classic vb too) when you compare it to other tools. One of the last guys I worked with too (mathmetician), informed me that there are flaws with the classic vb's compiler that makes it unreliable. I didn't know that, but I'm not surprised at all.

  11. #11
    suttilld is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    I've toyed with Linux at home just to see what the fuss is about, but didn't know enough to get anything reliably working. Any time anything went wrong it woud take me an age to figure it out. So I'm back to Windows on the basis that it works most of the time and is generally easier to fix. I played with a mac once, never again. Every Apple product I've owed has gone wrong iPads, iPhones and laptops. Anyway, back to the point. VS 2010 express it is. Cheers.

  12. #12
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    well that's out of sorts my friend....windows WORKS and linux and apple DONT? yeah, that's a bit backwards if you ask me!

    I have yet to try Ubuntu on linux, but I will get there. in general, most people I know that enjoy linux are those that have a moderate to high level of technical skill and enjoy being in control rather than being controlled.

    if there's anything about MS that I absolutely despise, it's their desire to control their users. matter of fact, I was looking for the ie temp folder the other day...had to get a hash out of a cookie file. guess what, CAN'T get to it by default in vista x64. and it's not visible by default either, even with CP options set accordingly.

    that's B.S.

  13. #13
    suttilld is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    Fair one. I suppose it's what you're used to. I didn't mean it to be black and white, just relating a few experiences. Don't you feel that Apple have the same mind set about user control? It's the Apple way or the highway, kind of approach? Which is all well and good, but what happens when it does go wrong. I had all sorts of issues with my iPhone and iPad, could I get support? Ironically Apple's support site crashed the iPad, he he! Ah well, it was a work iPad so I wasn't bothered. Happy days!

  14. #14
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    well I would have no idea...I don't own any apple 'mobile' products. and I never will. i always try to stay out of immersing myself in a global trend, simply because it's an easier life if you're in control rather than if you're being controlled. =) hmmmm...have I heard that before!?

    but yes I agree with you, I think when apple's success started to balloon with the help of Jobs's return to the scene they eventually ended up being pushy. but you can't avoid that. if demand is large enough you have to meet it or die. but I do think Apple's best days (morally, at least) are gone because Jobs is gone. I think he was the brains behind the company. but I think the magic was more about being able to work with a slew of developers with great ideas and not just do his own thing.

    matter of fact, did you know that the data for the siri voice came from a lab company that was bought by Apple? what I read was that they bought the company specifically to get that database, which apparently contained more than 50 years of human sentence formation and speech and conversion patterns among humans.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 08-10-2011, 11:59 AM
  2. Replies: 4
    Last Post: 08-05-2010, 01:26 PM
  3. Runtime Error '3027': Database or object is read only
    By 4x4Masters in forum Programming
    Replies: 4
    Last Post: 06-08-2010, 08:02 PM
  4. Replies: 3
    Last Post: 04-15-2010, 09:43 AM
  5. Replies: 5
    Last Post: 08-05-2009, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums