Always prompted for Save with function

G

Guest

I have this function in a module, however if I open the workbook and make no
changes to it and go to close it I am always prompted to save yes or no. How
can I fix this?
Function DocProps(prop As String)
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


TIA
GM
 
T

Tom Ogilvy

I am not sure it is perfect, because the point of the Volatile is to force
the function to update. You might need to come up with a cleaver time to
force a calculatefull - however, you would again have to avoid doing it when
no changes are made to the workbook.

Possibly You could do it in the workbook open event, then set

ThisWorkbook.Saved = True

at the end of the event.

Not up on events, see Chip Pearson's site for an overview
http://www.cpearson.com/excel/events.htm
 

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

Similar Threads

Making a function global 4
how can keep the modified date record in worksheet 2
Last person to modify 1
? on "date last saved" in cell 2
to Frank Kabel Please 2
UDF Function 15
Last Update 2
Last saved informations 1

Top