How do I use Access Shell to run Project with filter?

R

Rich NG

I am trying to have a Microsoft Access DB launch a specific Microsoft Project
MPP file and have the launched file filtered based on a criteria. In other
words (or, for example), I have a Project file labeled "Build Cars.mpp"; this
MPP file has a text column titled "Color". I want to click on a button in my
Access DB to launch Project, have it open up "Build Cars.mpp" and set a
filter for me to only see those lines where "Color = Red".

I have been able to figure out the SHELL command to launch Build Cars.mpp
but not to pass the filter information.

Thanks,
Rich
 
R

Rod Gill

Hi,

The shell command isn't needed. The following code (not tested) required a
reference in Access to Project (in VBE Tools, References) and a filter
called Color Filter that prompts for the car color.

Sub FilterProject()
Dim ProjApp As MSProject.Application
Set ProjApp = CreateObject("MSProject.Application")
ProjApp.FileOpen "Build Cars.mpp"
ProjApp.FilterApply "Color Filter", "Red"
Set ProjApp = Nothing
End Sub
 

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