A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

CODE working in 2003 but not in 2002



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 14th 06, 02:46 PM posted to microsoft.public.outlook.program_vba
gobjob
external usenet poster
 
Posts: 2
Default CODE working in 2003 but not in 2002

Does anyone know why this code is working in Outlook 2003 but not in Outlook
2002 SP3.

Sub Commandbutton18_Click
Set ExcelSheet = CreateObject("Excel.Application")
Set Sheet = ExcelSheet.Workbooks.Add("t:\Shared\Purchase Outlook
Forms\POletter.xls")
ExcelSheet.DisplayAlerts = False
ExcelSheet.visible = True
ExcelSheet.Cells(4,2) = NOW()
ExcelSheet.ActiveSheet.Protect

End sub

The error message only says, "Operation Failed."
ExcelSheet.Cells(5,2) = Item.UserProperties.find("Order Number").Value
ExcelSheet.Cells(7,2) = Item.UserProperties.find("(1) Requested by").Value
ExcelSheet.Cells(17,2) = Item.UserProperties.find("Ship to").Value

--
Gloriann O'Brien
Ads
  #2  
Old February 14th 06, 03:02 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default CODE working in 2003 but not in 2002

Which statement raises the error?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"gobjob" wrote in message ...
Does anyone know why this code is working in Outlook 2003 but not in Outlook
2002 SP3.

Sub Commandbutton18_Click
Set ExcelSheet = CreateObject("Excel.Application")
Set Sheet = ExcelSheet.Workbooks.Add("t:\Shared\Purchase Outlook
Forms\POletter.xls")
ExcelSheet.DisplayAlerts = False
ExcelSheet.visible = True
ExcelSheet.Cells(4,2) = NOW()
ExcelSheet.ActiveSheet.Protect

End sub

The error message only says, "Operation Failed."
ExcelSheet.Cells(5,2) = Item.UserProperties.find("Order Number").Value
ExcelSheet.Cells(7,2) = Item.UserProperties.find("(1) Requested by").Value
ExcelSheet.Cells(17,2) = Item.UserProperties.find("Ship to").Value

--
Gloriann O'Brien

  #3  
Old February 14th 06, 05:01 PM posted to microsoft.public.outlook.program_vba
gobjob
external usenet poster
 
Posts: 2
Default CODE working in 2003 but not in 2002

I'm not sure. I have 2003 sp1. Someone in another office has 2002 sp3 and
this is not setup with the debug. I'm trying to avoid a trip to Atlanta to
see what is happening since I have no one in this office with 2002. I know
there were times I had to make code changes with different packs for example
when UserProperties.Find(fieldname) wasn't working with the .Find. I just
don't recall this code needing to be changed.

He is able to access the automatic sequencing numbers that are in access on
the same drive. So the drive is not the issue. I don't know how it can be
the data that I'm writing to excel because it is working for everyone else.
So it leads me to believe it is in the first few statements.

Thanks.
--
Gloriann O'Brien


"Sue Mosher [MVP-Outlook]" wrote:

Which statement raises the error?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"gobjob" wrote in message ...
Does anyone know why this code is working in Outlook 2003 but not in Outlook
2002 SP3.

Sub Commandbutton18_Click
Set ExcelSheet = CreateObject("Excel.Application")
Set Sheet = ExcelSheet.Workbooks.Add("t:\Shared\Purchase Outlook
Forms\POletter.xls")
ExcelSheet.DisplayAlerts = False
ExcelSheet.visible = True
ExcelSheet.Cells(4,2) = NOW()
ExcelSheet.Cells(5,2) = Item.UserProperties.find("Order Number").Value
ExcelSheet.Cells(7,2) = Item.UserProperties.find("(1) Requested by").Value
ExcelSheet.Cells(17,2) = Item.UserProperties.find("Ship to").Value
ExcelSheet.ActiveSheet.Protect

End sub

The error message only says, "Operation Failed."


--
Gloriann O'Brien


  #4  
Old February 14th 06, 05:31 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default CODE working in 2003 but not in 2002

I would definitely not use UserProperties.Find, since there are known problems with it in at least one Outlook version.

"Operation failed" errors can be very difficult to track down. It might be cheaper to buy a copy of Office XP or Outlook 2002 on eBay than to take a trip to Atlanta. If it's just one user and others with the same version have no problems, then I'd have that user run Help | Detect and Repair.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"gobjob" wrote in message ...
I'm not sure. I have 2003 sp1. Someone in another office has 2002 sp3 and
this is not setup with the debug. I'm trying to avoid a trip to Atlanta to
see what is happening since I have no one in this office with 2002. I know
there were times I had to make code changes with different packs for example
when UserProperties.Find(fieldname) wasn't working with the .Find. I just
don't recall this code needing to be changed.

He is able to access the automatic sequencing numbers that are in access on
the same drive. So the drive is not the issue. I don't know how it can be
the data that I'm writing to excel because it is working for everyone else.
So it leads me to believe it is in the first few statements.

Thanks.
--
Gloriann O'Brien


"Sue Mosher [MVP-Outlook]" wrote:

Which statement raises the error?

"gobjob" wrote in message ...
Does anyone know why this code is working in Outlook 2003 but not in Outlook
2002 SP3.

Sub Commandbutton18_Click
Set ExcelSheet = CreateObject("Excel.Application")
Set Sheet = ExcelSheet.Workbooks.Add("t:\Shared\Purchase Outlook
Forms\POletter.xls")
ExcelSheet.DisplayAlerts = False
ExcelSheet.visible = True
ExcelSheet.Cells(4,2) = NOW()
ExcelSheet.Cells(5,2) = Item.UserProperties.find("Order Number").Value
ExcelSheet.Cells(7,2) = Item.UserProperties.find("(1) Requested by").Value
ExcelSheet.Cells(17,2) = Item.UserProperties.find("Ship to").Value
ExcelSheet.ActiveSheet.Protect

End sub

The error message only says, "Operation Failed."


--
Gloriann O'Brien


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Suggest Stoped working in Outlook 2003 [email protected] Outlook - Using Contacts 3 February 3rd 06 08:53 PM
Hotfix OUTLOOKff interfering with working code. [email protected] Add-ins for Outlook 2 January 23rd 06 11:49 PM
code : Code : 800cccd2 scotty971fr Outlook Express 1 January 19th 06 11:59 PM
Direct Booking not working for Outlook 2002 clients RussK Outlook - Calandaring 1 January 19th 06 03:27 PM
Reminders stopped working in Outlook 2003--Is there a way to reset? resonator80 Outlook - General Queries 5 January 11th 06 03:00 PM


All times are GMT +1. The time now is 07:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.