Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Switching Excel App from Single user to Network environment

I need to deliever an application to a network-type business client who
running MSO 2003 (all apps, including Outlook and Excel). The below code
works fine on my in-house Single user PC (Everything is on drive C:). The
below code is working great on my single user system. What are the issues I
can expect when I try and run this code "AS-IS" installed on his PC - where
his incoming mail is somehow on the mysterious "mail server", etc.. I'm at a
loss as to what to do if this code doesn't work once I copy the excel file to
his hard drive and run it. Can someone assist me? Thanks in advance...


Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer
Dim C As Range
Dim TempName As String
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Personal
Folders").Folders("Inbox").Folders("DailyReports")

Range("C5:E200").ClearContents

For Each olMail In Fldr.Items
TempName = Mid(olMail.Subject, 13, WorksheetFunction.Find("(",
olMail.Subject) - 14)
With ActiveSheet.Range(Range("B5"), Range("B5").End(xlDown))
Set C = .Find(What:=TempName, LookAt:=xlWhole, _
LookIn:=xlValues, SearchOrder:=xlByColumns)
End With
With ActiveSheet
If Not C Is Nothing Then
C.Offset(0, 1).Value = olMail.ReceivedTime
End If
End With

Next olMail
Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Switching Excel App from Single user to Network environment

As long as the other user is in fact using Outlook, your code should
run fine. It doesn't matter what sort of mail server is being used.
Those details are handled by Outlook automatically. Moreover, it
shouldn't matter if there is more than one user defined on a single
machine. Everything accessible via Outlook will be for the currently
logged on user.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 19 Feb 2009 11:12:01 -0800, JMay
wrote:

I need to deliever an application to a network-type business client who
running MSO 2003 (all apps, including Outlook and Excel). The below code
works fine on my in-house Single user PC (Everything is on drive C:). The
below code is working great on my single user system. What are the issues I
can expect when I try and run this code "AS-IS" installed on his PC - where
his incoming mail is somehow on the mysterious "mail server", etc.. I'm at a
loss as to what to do if this code doesn't work once I copy the excel file to
his hard drive and run it. Can someone assist me? Thanks in advance...


Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer
Dim C As Range
Dim TempName As String
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Personal
Folders").Folders("Inbox").Folders("DailyReports" )

Range("C5:E200").ClearContents

For Each olMail In Fldr.Items
TempName = Mid(olMail.Subject, 13, WorksheetFunction.Find("(",
olMail.Subject) - 14)
With ActiveSheet.Range(Range("B5"), Range("B5").End(xlDown))
Set C = .Find(What:=TempName, LookAt:=xlWhole, _
LookIn:=xlValues, SearchOrder:=xlByColumns)
End With
With ActiveSheet
If Not C Is Nothing Then
C.Offset(0, 1).Value = olMail.ReceivedTime
End If
End With

Next olMail
Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Switching Excel App from Single user to Network environment

Chip,

Thanks -- Your comments gave me the "guts" to move forward. I viewed the
clients
Outlook file structure as compared to mine and here are the 2 side by side,,,

Per My Office (single-User) sys Per the Network Clients sys
Mail Folders Mail Folders
All Mail Items All Mail Folders
Personal Folders Mailbox - John Doe
Inbox Inbox
DailyReports DailyReports

So I modified my original code line
from:

Set Fldr = olNs.Folders("Personal
Folders").Folders("Inbox").Folders("DailyReports")

to:

Set Fldr = olNs.Folders("Mailbox - John
Doe").Folders("Inbox").Folders("DailyReports")

First time, I got an error -- But then went in VBA to Tools, References
Found Microsoft Outlook - V11 (or the like).

The 5:00 Friday whistle Blew and I was kicked out-of-the-office just as I
was making progress. Will return next week (with my fingers crossed) hoping
that it works. I know how to Step thru code (F8) and use the immediate widow
to
test variables - so I hope I'm there ----- Thanks again for instilling the
confidence
to move forward - I wouldn't if you had not responded !!!

Jim



"Chip Pearson" wrote:

As long as the other user is in fact using Outlook, your code should
run fine. It doesn't matter what sort of mail server is being used.
Those details are handled by Outlook automatically. Moreover, it
shouldn't matter if there is more than one user defined on a single
machine. Everything accessible via Outlook will be for the currently
logged on user.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 19 Feb 2009 11:12:01 -0800, JMay
wrote:

I need to deliever an application to a network-type business client who
running MSO 2003 (all apps, including Outlook and Excel). The below code
works fine on my in-house Single user PC (Everything is on drive C:). The
below code is working great on my single user system. What are the issues I
can expect when I try and run this code "AS-IS" installed on his PC - where
his incoming mail is somehow on the mysterious "mail server", etc.. I'm at a
loss as to what to do if this code doesn't work once I copy the excel file to
his hard drive and run it. Can someone assist me? Thanks in advance...


Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer
Dim C As Range
Dim TempName As String
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Personal
Folders").Folders("Inbox").Folders("DailyReports" )

Range("C5:E200").ClearContents

For Each olMail In Fldr.Items
TempName = Mid(olMail.Subject, 13, WorksheetFunction.Find("(",
olMail.Subject) - 14)
With ActiveSheet.Range(Range("B5"), Range("B5").End(xlDown))
Set C = .Find(What:=TempName, LookAt:=xlWhole, _
LookIn:=xlValues, SearchOrder:=xlByColumns)
End With
With ActiveSheet
If Not C Is Nothing Then
C.Offset(0, 1).Value = olMail.ReceivedTime
End If
End With

Next olMail
Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify Excel (2003) code for Network environment JMay Setting up and Configuration of Excel 1 March 9th 09 01:05 PM
Controlling user environment Colinhp Excel Programming 3 July 10th 06 01:10 PM
Workbooks are getting damaged in network environment Mikeyhend Excel Programming 0 April 12th 06 12:52 PM
Editing in a multi-user environment Daverob Excel Discussion (Misc queries) 2 March 3rd 06 03:51 PM
Is it possible to use excel in a multi user environment? Sonia I. Excel Discussion (Misc queries) 1 July 15th 05 01:22 AM


All times are GMT +1. The time now is 06:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"