Click here to Skip to main content
16,022,352 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I using these flags values to open the excel file from 97-2003 to 2019
C++
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)
Posted
Updated 6-Jun-24 3:46am
v2
Comments
OriginalGriff 6-Jun-24 5:25am    
And?
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?

This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Use the "Improve question" widget to edit your question and provide better information.
[no name] 25-Jun-24 3:26am    
What do you expect those values to do for you? In my system the BrowserFlags value is set at 8, and the EditFlags at zero. You should also not modify the registry unless you are sure that you understand it, as Microsoft will not support you if you break your system.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900