Problems with FileSaveAs

J

JJ

I recently got upgraded at work from a Windows 2000 computer to a
Windows XP computer. (Yeah... we're REALLY progressive over here!)
Anyways, I am using Project 2003 and one of my subroutines has the
following line:

FileSaveAs newfilename, pjMPP

where, newfilename is a string that I obtain by running some File API
code which still works.

This line worked fine on my Windows 2000 computer but I get a Run-time
error (1004) when I run it on a Windows XP computer.

Any ideas on how to fix this? Is there another method I need to use to
save the file under a different filename?

Thanks in advance!
JJ
 
J

JJ

I tried to record a macro of me saving a file. Unfortunately, it does
not record anything.

I DID notice however in Excel 2003 that there is a "FileDialog" object
operates similar to FileSaveAs in Project. But, I can't find this
object when I am working in Project. Is there some a reference that I
need in order for this to work in Project OR is there a reference that
I need in order to make FileSaveAs work again?
 
R

Rod Gill

Hi,

FileDialog has not been implemented for Project.

I think you have a corrupt installation if Project does not record a file,
save as. Did you start recording then actually save the project using file,
save as then stop recording? That should always record code for an action
like save as.

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 
J

JJ

I recorded the following on an empty Project file:
1) Typed in "Test" for name of Task ID 1
2) Performed a File Save
3) Performed a File Save As
4) Typed in "Test 2" for the Name of Task ID 2.

Everything got recorded except the FileSaveAs.

Could you please verify this on your computer to see if you get the
same results. I don't know if this makes a difference but... I am
installing an Microsoft Project 2003 Standard which is available from
my company's intranet.

Thanks!
JJ
 
J

JJ

I re-installed Microsoft Project 2003 and it seemed to solve the
problem of recording a macro which does a "File Save As."

It seems the macro uses the FormatID property rather than the Format
property when doing a FileSaveAs. Therefore, my code above should
read...

FileSaveAs Name:=newfilename, FormatID:="MSProject.MPP"

My original code was the following:
FileSaveAs Name:=newfilename, Format:=pjMPP

SO... can someone tell what the difference is between FormatID and
Format? Why would one work better than the other?

Thanks!
JJ
 

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