Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Post method to send ThisWorkbook to a public folder

Status
Not open for further replies.

Jeepers321

Technical User
Oct 17, 2000
17
US
I am trying to have a button on my spreadsheet that when the user clicks it that it post the spreadsheet into an exchange folder on the our intranet. I believe I am almost there but for the life of me I don't know why it still request that the user selects a folder. Here is the code I have so far.


Private Sub BtnPost_Click()

Dim myOlApp As Outlook.Application
Dim myNameSpace As NameSpace
Dim myFolder As MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.Folders("Public Folders") _
.Folders("All Public Folders") _
.Folders("Strategic Development") _
.Folders ("Assessment")

ThisWorkbook.Post myFolder

End Sub

myFolder is showing as Assessment but why doesn't it go ahead and send it there.
 
According to the Excel help file script below the Post method always prompts the user. Why even have the variant for DestName I don't know. Also, your DestName was an Outlook folder object not a variant. This is why you are having you problem but how to correct it I'll need to defer to others.

-------------------------------------------------------
expression.Post(DestName)
expression Required. An expression that returns a Workbook object.

DestName Optional Variant. This argument is ignored. The Post method prompts the user to specify the destination for the workbook.

Example
This example posts the active workbook.

ActiveWorkbook.Post
--------------------------------------------------------
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top