The following is an example of modifying the PowerExcel.cfg saved user options on launch of an Excel Template.  This example disables AutoShowSidebar option.


A module was added (or Added to an existing module) containing the following VBA:


Sub Auto_Open()

Dim objFSO
Const ForReading = 1
Const ForWriting = 2
Dim objTS 'define a TextStream object
Dim strContents As String
Dim fileSpec As String
'Dim CStr as String

fileSpec = CStr(Environ("USERPROFILE") & "\AppData\Local\Olation\PowerExcel.cfg")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(fileSpec, ForReading)
strContents = objTS.ReadAll
strContents = Replace(strContents, "<AutoShowSidebar>true</AutoShowSidebar>", "<AutoShowSidebar>false</AutoShowSidebar>")

objTS.Close

Set objTS = objFSO.OpenTextFile(fileSpec, ForWriting)
objTS.Write strContents
objTS.Close


End Sub