473,387 Members | 1,318 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Object Variable or with block variable not set

I am getting this error when the code enters this part of the module.

Expand|Select|Wrap|Line Numbers
  1. MailboxResult = GetMailboxInfo("OutlookID")
  2.  
  3. If MailboxResult <> "Error" Then
  4.     Set MyRecipient = objOutlook.Session.GetRecipientFromID(MailboxResult)
  5. Else
  6.     GoTo Code_Exit
  7. End If
The error mentioned in the title occurs when the bold portion of the code is executed.

I have declared the the variables well before using them

Expand|Select|Wrap|Line Numbers
  1. Dim MyRecipient As Object
  2. Dim objOutlook  As Object

Can you please help me with this?
Nov 2 '06 #1
10 2857
NeoPa
32,556 Expert Mod 16PB
You have no code listed which assigns the objOutlook variable to any object.
I would guess you need something like
Expand|Select|Wrap|Line Numbers
  1. Set objOutlook = Outlook
Alternatively, just use 'Outlook' in your code. I'm assuming that is the object you want to use.
Nov 2 '06 #2
I am very sorry not to mention that part of the code!!! But i have set the object already and this is how i do it.

Expand|Select|Wrap|Line Numbers
  1. Set objOutlook = GetOutlook(MakeVisible:=false)
The function returns the object correctly and i have confirmed that. Can you please tell me on what other probalities are there??

And thanks for your quick response.
Nov 3 '06 #3
And one more thing, the same application works for all the users correctly, only one user is facing this problem. I was terrified to hear this.
Nov 3 '06 #4
Killer42
8,435 Expert 8TB
And one more thing, the same application works for all the users correctly, only one user is facing this problem. I was terrified to hear this.
Could it be that that one user does not have an Outlook account properly set up?
Nov 3 '06 #5
Nope, his account is properly setup and checked it up personally. Could it be because of some patched which gets installed frequently???
Nov 3 '06 #6
Killer42
8,435 Expert 8TB
Nope, his account is properly setup and checked it up personally. Could it be because of some patched which gets installed frequently???
I don't actually know much about this, but I would like to know, are we talking about a specific user, or a specific PC, or both?

Just trying to narrow down the problem - what happens with the same user on a different PC, or vice versa?
Nov 3 '06 #7
Thats a very good question. Actually its about the PC. The same user when logging in from a different PC does not face this issue.
Nov 3 '06 #8
NeoPa
32,556 Expert Mod 16PB
Have you checked that all the References (libraries) are present on your one problem PC?
Nov 3 '06 #9
Killer42
8,435 Expert 8TB
Have you checked that all the References (libraries) are present on your one problem PC?
Maybe a removal/reinstall of Outlook on that PC would help? Or even a complete Windows reinstall, though this would be a last resort.
Nov 5 '06 #10
Yes, Finally after lots of searches, i asked the user to rebuild his PC. Thanks !!!
Nov 7 '06 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Hung Jung Lu | last post by:
Hi, Does anybody know where this term comes from? "First-class object" means "something passable as an argument in a function call", but I fail to see the connection with "object class" or...
10
by: Michael McCracken | last post by:
Hi, I have a problem with unittest.TestCase that I could really use some help with. I have a class File in module File. The important thing about File for this discussion is that it's simple -...
8
by: Lauren Quantrell | last post by:
I get the following error: "Object variable or Width block variable not set error" trying to run this in my Access2000 .ADP database: CurrentDb.Properties.Append...
8
by: Mark Neilson | last post by:
1. What is the best way to make a single instance of my top level class (DLL) internally available to all other members of the assembly? The top level object is where all other access is made in...
6
by: Neo Geshel | last post by:
I am trying to deal with an image in code-behind. I consistently get the following error: Server Error in '/' Application. Object variable or With block variable not set. Description: An...
44
by: petermichaux | last post by:
Hi, I have been using the following line of code to create an object called "Serious" if it doesn't already exist. if (Serious == null) {var Serious = {};} This works in the scripts I use...
3
by: Richard Hollenbeck | last post by:
I've marked the line in this subroutine where I've been getting this error. It may be something stupid but I've been staring at this error trying to fix it for over an hour. I'm pretty sure the...
1
by: abhijmenbumca07 | last post by:
Object variable or With block variable not set. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information...
4
by: BrianAdev | last post by:
Why It throw an error of <Object variable or With block variable not set> set objAccess = GetObject(strMdbPath) objAccess.DoCmd.SetWarning False objAccess.DoCmd.OpenReport strReportName, 0 'It...
3
by: Newbie19 | last post by:
I'm trying to get a list of all subfolders in a folder on a share drive, but I keep on getting this error message: Object variable or With block variable not set. Description: An unhandled...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.