Confirmation Required to Save File even when DisplayAlerts = False

A

Andibevan

I am trying to create some code the Will Be Run From MS Access 2k in order
to open a Project file and then save it as an mdb

I want it to do this without any prompts for the user to hit. I have tried
the following but the user is still prompted - What do I need to do in order
to get this to work without any prompts?

TIA

Andi


Sub TestConvert()
Dim oMSProject As MSProject.Application
Set oMSProject = CreateObject("MSProject.Application")
oMSProject.Application.DisplayAlerts = False
oMSProject.FileOpen Name:="C:\Documents\Dependancies V34.mpp",
ReadOnly:=True, FormatID:="MSProject.MPP"
oMSProject.FileSaveAs Name:="<C:\Documents\V34_Convert.mdb>",
FormatID:="MSProject.MDB8"
oMSProject.Application.DisplayAlerts = True
oMSProject.Quit
oMSProject = Nothing
End Sub
 
J

John

Andibevan said:
I am trying to create some code the Will Be Run From MS Access 2k in order
to open a Project file and then save it as an mdb

I want it to do this without any prompts for the user to hit. I have tried
the following but the user is still prompted - What do I need to do in order
to get this to work without any prompts?

TIA

Andi


Sub TestConvert()
Dim oMSProject As MSProject.Application
Set oMSProject = CreateObject("MSProject.Application")
oMSProject.Application.DisplayAlerts = False
oMSProject.FileOpen Name:="C:\Documents\Dependancies V34.mpp",
ReadOnly:=True, FormatID:="MSProject.MPP"
oMSProject.FileSaveAs Name:="<C:\Documents\V34_Convert.mdb>",
FormatID:="MSProject.MDB8"
oMSProject.Application.DisplayAlerts = True
oMSProject.Quit
oMSProject = Nothing
End Sub

Andivevan,
This may be a long shot but I remember that with some methods the pop-up
can be avoided by explicitly listing certain arguments. Your code does
list the format but try including other file attributes and see if that
helps. There is probably just one or two that are needed but you may
need to go through them one by one to see which those are.

By the way, I assume you have set a reference to the Project object
library. If may not be needed with the simple code you have, but it
can't hurt and is generally good practice when working between
applications.

John
Project MVP
 
A

Andibevan

Thanks for the suggestion,

I'l try it today and see if that makes any difference then report Back

Andi
 
J

John

Andibevan said:
Thanks for the suggestion,

I'l try it today and see if that makes any difference then report Back

Andi

Andi,
You're welcome. I hope that will help.
John
 
A

Andibevan

I think I may be getting there but no result as yet. Here is the code I
have so far:-

Set oMSProject = CreateObject("MSProject.Application")
oMSProject.Visible = True
oMSProject.Application.DisplayAlerts = False
oMSProject.FileOpen Name:="C:\Documents\Meetings\SMV Team Meeting\Go-Live
Dependancies V34.mpp", ReadOnly:=True, FormatID:="MSProject.MPP"
oMSProject.FileSaveAs Name:="<C:\Documents\Meetings\SMV Team Meeting\Go-Live
Dependancies V34_Convert.mdb>", _
FormatID:="MSProject.MDB8", Backup:=False, ReadOnly:=False,
TaskInformation:=True _
, Filtered:=False

oMSProject.Application.DisplayAlerts = True


oMSProject.Application.DisplayAlerts = True
oMSProject.Quit
'oMSProject = Nothing

If I use this Macro, the file opens but it does not actually save the file
which I find wierd. If I remove TaskInformation:=True and Filtered:=False
the file asks to be prompted but does actually save. Any more good ideas?

TIA

Andi
 

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