Using VBA to Save Project Data to WSS List

T

tonyzink

I know that you can save Excel and Access data to a SharePoint list
using VBA, but what about Project data?

Is there a way to connect Project to a SharePoint list using the object
model, then add / delete / update list items? Based on what I've read,
connecting to a SharePoint list is not straightforward, and may require
opening a Project schedule first in order to establish the connection.

Is there a way to connect Project to a SharePoint list using web
services, then add / delete / update list items?

Thanks!

Tony Zink
URL: http://www.msprojectreporter.com
Blog: http://www.pptspaces.com/msprojectreporterblog
 
R

Rod Gill

Not that I am aware of. The only way I know is to directly update the list
data in SQL Server, though I think this is not recommended. The safest way
might be to create a VBA macro in Access to read the Project data then
export to SharePoint.
 
A

Ali JAAFER

You can read data from office project VBA by adding a excel workbook and sheet to vba project (add microsoft excel reference).

You can obtain this code using Macro record in Excel (excel 2007) and import data from web in data menu


Dim b As Workbook


With b.Sheets(1).QueryTables.Add(Connection:= _
"URL;http://sharepoint.dll?CS=65001&XMLD...}&View={B1A459E0-48D9-4CFF-8BF0-5C88A4852824}" _
, Destination:=Range("$A$1"))
.Name = "AllItems"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNonet
.WebTables = _
"""{8C0733ED-3AC9-4B76-B1BA-0FCEF3E894A4}-{B1A459E0-48D9-4CFF-8BF0-5C88A4852824}"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.EditWebPage = "http://shaepointsite/AllItems.aspx"
.Refresh BackgroundQuery:=False
End With


Now in your Office project VBA and using list data stored into the excel sheet object your can add the task to your project

dim a as tasks
set a=pj.addtask("b.sheets(1).cells(row,col),tasknum)

AJ



Rod Gill wrote:

Not that I am aware of.
22-Jan-07

Not that I am aware of. The only way I know is to directly update the list
data in SQL Server, though I think this is not recommended. The safest way
might be to create a VBA macro in Access to read the Project data then
export to SharePoint

--

Rod Gil
Microsoft MVP for Projec
The book on Project VBA http://www.projectvbabook.co


Previous Posts In This Thread:

Using VBA to Save Project Data to WSS List
I know that you can save Excel and Access data to a SharePoint lis
using VBA, but what about Project data

Is there a way to connect Project to a SharePoint list using the objec
model, then add / delete / update list items? Based on what I've read
connecting to a SharePoint list is not straightforward, and may requir
opening a Project schedule first in order to establish the connection

Is there a way to connect Project to a SharePoint list using we
services, then add / delete / update list items

Thanks

Tony Zin
URL: http://www.msprojectreporter.co
Blog: http://www.pptspaces.com/msprojectreporterblog

Not that I am aware of.
Not that I am aware of. The only way I know is to directly update the list
data in SQL Server, though I think this is not recommended. The safest way
might be to create a VBA macro in Access to read the Project data then
export to SharePoint

--

Rod Gil
Microsoft MVP for Projec
The book on Project VBA http://www.projectvbabook.co



Submitted via EggHeadCafe - Software Developer Portal of Choice
An Ultra-Simple Sum of Numbers Captcha UserControl
http://www.eggheadcafe.com/tutorial...a7-5d8f632aef8d/an-ultrasimple-sum-of-nu.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top