I using these flags values to open the excel file from 97-2003 to 2019
HKEY hExcel2k7;
DWORD dwValue = 0x80000A00;
DWORD dwEdit=0x00010000;
if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Classes\\Excel.Sheet.12"), &hExcel2k7) == ERROR_SUCCESS)
{
if (RegSetValueEx(hExcel2k7,_T("BrowserFlags"),NULL,REG_DWORD,(PBYTE)&dwValue,sizeof(PDWORD))==ERROR_SUCCESS)
{
if (RegSetValueEx(hExcel2k7,_T("EditFlags"),NULL,REG_DWORD,(PBYTE)&dwEdit,sizeof(PDWORD))==ERROR_SUCCESS)
{
RegCloseKey(hExcel2k7);
}
}
}
if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Classes\\Excel.Sheet.8"), &hExcel2k7) == ERROR_SUCCESS)
{
if (RegSetValueEx(hExcel2k7,_T("BrowserFlags"),NULL,REG_DWORD,(PBYTE)&dwValue,sizeof(PDWORD))==ERROR_SUCCESS)
{
if(RegSetValueEx(hExcel2k7,_T("EditFlags"),NULL,REG_DWORD,(PBYTE)&dwEdit,sizeof(PDWORD))==ERROR_SUCCESS)
{
RegCloseKey(hExcel2k7);
}
}
}
if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Classes\\Excel.SheetMacroEnabled.12"), &hExcel2k7) == ERROR_SUCCESS)
{
if (RegSetValueEx(hExcel2k7,_T("BrowserFlags"),NULL,REG_DWORD,(PBYTE)&dwValue,sizeof(PDWORD))==ERROR_SUCCESS)
{
if(RegSetValueEx(hExcel2k7,_T("EditFlags"),NULL,REG_DWORD,(PBYTE)&dwEdit,sizeof(PDWORD))==ERROR_SUCCESS)
{
RegCloseKey(hExcel2k7);
}
}
}
But these values fails to open the excel files 2021
What I have tried:
Flags values for excel 2021(Preview of excel in mfc 2021 office)