Office:mac 2011 VBA GetSetting continues to work after deleting the plist file

I am writing a VBA add-in for Office:mac 2011.

I use the SaveSetting, GetSetting, DeleteSetting trio for storing user preferences as done in Windows. Unlike Windows, Mac is not using a registry but individual plist files.

Let's say I save a setting like this:
SaveSetting "myAppName", "mySection", "myKey", "mySetting"

Open in new window

It will create the following file:

~/Library/Preferences/myAppName.plist

I can the return the setting in the Immediate window:
?GetSetting ("myAppName", "mySection", "myKey", "?")
returns -> mySetting

Open in new window

If I now delete that plist file and try to get the get the setting again, one would expect to get the default "?" returned but surprisingly, the string "mySetting" is returned!

I used a specialist tool to search my entire Mac for any other copies of myAppName.plist and found none so is Microsoft Office storing a backup copy with a different name somewhere?

I need to delete all traces of the app's plist file(s) to be able to test a user first run experience.
LVL 14
Jamie GarrochPowerPoint Consultant & DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

strungCommented:
Did you quit the application before deleting the plist? The application probably keeps the plist information in memory and writes it to the disk on quitting.
1
strungCommented:
Also, check for preferences in

/Library/Preferences

as well as in

~/Library/Preferences
1
Jamie GarrochPowerPoint Consultant & DeveloperAuthor Commented:
Hi strung.

I was hoping your first suggestion might be the answer but I started PowerPoint, created a new blank deck and issued a single SaveSetting statement to create a new plist file. I then closed PowerPoint, deleted the plist file, started PowerPoint and used the GetSetting statement to successfully return the value that shouldn't exist!

I had already checked multiple Library locations and various MSO folders for duplicates but not found any.

Interestingly, if I try to save the exact same setting again, the plist file isn't regenerated but if I change the value, it is.

I have decided to write a DeleteAllSettings function but I'd still like to solve this issue as I want to be able to deploy default settings in a plist file during installation of the add-in. Currently, if I edit the add-in's plist file with a text editor, the changes are not returned using GetSetting!!!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

strungCommented:
I wonder if the setting is being stored in a generalized Office plist file rather than a specific PPT one.

Try this:

Close all apps. Delete the plist in question.

Open a Finder window to the root of your hard drive.

In the search window, search for

.plist

Click the + button on the top right and change "kind" is "any"  to "System Files" "Are Included"

Make sure the Finder window is large enough to show the column "last modified".

Click on the column heading to see what are the most recently changed plist files.

Restart PPT. Use your script to change the plist entry to something new and see what plist files change. Then close PPT and see what plist files change.
0
Jamie GarrochPowerPoint Consultant & DeveloperAuthor Commented:
I've just conducted another test using the "Find Any File" utility. I forced PowerPoint to regenerate my test plist file and then set Find Any File to search for all files on my system (and I mean ALL files, including system ones) with the criteria  "creation date is within the past 1 minute". It found 3 files, one of which is my plist file and the other two appear to be unrelated; "Local State" (binary), "TransportSecurity" (binary). So I am really confused as to how PowerPoint is recalling settings from plist files!
0
strungCommented:
Close PPT. Delete the plist file. Open PPT. Close it again. Then manually examine the plist file, rather than using your script to see if you key has been added back in.
0
Jamie GarrochPowerPoint Consultant & DeveloperAuthor Commented:
I used Find Any File to do the same search (I gave up on Finder earlier today as it didn't list my add-in's plist file but did find loads of others when set to include system files).

I found the following files modified after saving a setting and closing PowerPoint (the only MSO app to be opened):

~/Library/Preferences/myAppName.plist
~/Library/Preferences/com.microsoft.Powerpoint.plist
~/Library/Preferences/com.microsoft.visualbasic.plist

Neither of the last two have any readable reference to the setting I changed in myAppName.plist :-(

I say readable as they are XML files but the PowerPoint one has this node at the start of the file:

<key>14\File Aliases\Alias ID: 420</key>
	<data>
	AAAAAAFgAAIAAQxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADOl6vDSCsAAAAI+ZAJ
	RG9jdW1lbnRzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
	AAAAAAAAAAAAAAAAAAj5kc6XrMcAAAAAAAAAAP////8AAAkgAAAAAAAAAAAAAAAAAAAA
	DEphbWllR2Fycm9jaAAQAAgAAM6Xq8MAAAARAAgAAM6XrMcAAAABAAgACPmQAAJkjgAC
	ACtNYWNpbnRvc2ggSEQ6VXNlcnM6AEphbWllR2Fycm9jaDoARG9jdW1lbnRzAAAOABQA
	CQBEAG8AYwB1AG0AZQBuAHQAcwAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAAS
	ABxVc2Vycy9KYW1pZUdhcnJvY2gvRG9jdW1lbnRzABMAAS8AABUAAgAT//8AAA==
	</data>

Open in new window

0
Jamie GarrochPowerPoint Consultant & DeveloperAuthor Commented:
I followed your suggestion:

Close PPT. Delete the plist file. Open PPT. Close it again. Then manually examine the plist file, rather than using your script to see if you key has been added back in.

The plist file never reappears in the expected ~/Library/Preferences location unless I use script to add a new setting or modify an existing one so I can't manually examine it.
0
strungCommented:
You should be able to read the plist files with Property List Editor:  http://osxdaily.com/2010/05/12/use-property-list-editor-to-edit-plist-files-for-free/
0
Jamie GarrochPowerPoint Consultant & DeveloperAuthor Commented:
I extended the time-based search after regenerating the plist file from PowerPoint VBA to "all files modified in the last minute" and got a larger result, one of which could be a candidate but it's a binary file:

PowerPoint data.data file
data.data.png
0
Jamie GarrochPowerPoint Consultant & DeveloperAuthor Commented:
I've decided to abandon this reverse-engineering approach and will deploy settings in my own file format and have VBA read them from that file and save them using SaveSetting back out to wherever PowerPoint is mysteriously keeping the data! Yet another reason why Office:mac VBA programming is so unproductive!!!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Mac OS X

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.