|
|
|
date: Wed, 11 Jun 2008 03:17:00 -0700,
group: microsoft.public.excel.sdk
back
Re: xlfGetFormula with Excel 2007 in protected sheets
This looks like a bug in Excel 2007, although it may not always be
reproducible. The workaround is to check the status of the workbook before
calling the function.
xlfGetWorkbook with arguments 14 and 15 inform of the protected status.
14 TRUE, if the workbook structure is protected; otherwise, FALSE.
15 TRUE, if the workbook windows are protected; otherwise, FALSE.
You can alter the protected status using xlcWorkbookProtect. Here's an
extract from the Macrofun help file.
Equivalent to choosing the Protect Workbook command from the Protection
submenu on the Data menu. Controls protection of workbooks.
Syntax
WORKBOOK.PROTECT(structure, windows, password)
WORKBOOK.PROTECT?(structure, windows, password)
Structure specifies whether the structure of the workbook is protected.
If TRUE, the structure is protected. If FALSE or omitted, the structure is
not protected.
Windows specifes whether the windows of the workbook are protected. If
TRUE, the windows are protected. If FALSE or omitted, the windows are not
protected.
Password specifies whether to protect the workbook with a password. If
omitted no password is used. When recording a macro, this argument is not
recorded. In the dialog box form of this function, you can specify a
password.
Remarks
To protect a sheet in a workbook, use the PROTECT.DOCUMENT function.
Related Functions
PROTECT.DOCUMENT Protects a sheet in a workbook
List of Command-Equivalent Functions
Hope this helps.
Steve Dalton
"Britta" wrote in message
news:A5208E3C-56B7-4E81-97FF-3508E14F45B5@microsoft.com...
> Dear all,
>
> I have a C-dll created with Excel developer's kit, that works fine with
> previous versions of Excel. But switching to Excel 2007, I encountered the
> following error:
>
> xlfGetFormula works fine as long as the sheet is not protected. As soon as
> the sheet is protected and although the cell is not protected,
> xlfGetFormula
> crashes with a security violation error.
>
> Thank you very much for your help,
>
> Britta
date: Mon, 4 Aug 2008 21:25:17 +0100
author: Steve Dalton NOsteveSPAM(at)NOeigensysSPAM(dot)com
Re: xlfGetFormula with Excel 2007 in protected sheets
Dear Steve,
thanks a lot for the description of the workaround. I think it is a good
idea, and I will use it in my program.
Kind regards
Britta
"Steve Dalton" wrote:
> This looks like a bug in Excel 2007, although it may not always be
> reproducible. The workaround is to check the status of the workbook before
> calling the function.
>
>
> xlfGetWorkbook with arguments 14 and 15 inform of the protected status.
>
> 14 TRUE, if the workbook structure is protected; otherwise, FALSE.
> 15 TRUE, if the workbook windows are protected; otherwise, FALSE.
>
>
>
> You can alter the protected status using xlcWorkbookProtect. Here's an
> extract from the Macrofun help file.
>
> Equivalent to choosing the Protect Workbook command from the Protection
> submenu on the Data menu. Controls protection of workbooks.
>
> Syntax
>
> WORKBOOK.PROTECT(structure, windows, password)
> WORKBOOK.PROTECT?(structure, windows, password)
> Structure specifies whether the structure of the workbook is protected.
> If TRUE, the structure is protected. If FALSE or omitted, the structure is
> not protected.
> Windows specifes whether the windows of the workbook are protected. If
> TRUE, the windows are protected. If FALSE or omitted, the windows are not
> protected.
> Password specifies whether to protect the workbook with a password. If
> omitted no password is used. When recording a macro, this argument is not
> recorded. In the dialog box form of this function, you can specify a
> password.
>
> Remarks
>
> To protect a sheet in a workbook, use the PROTECT.DOCUMENT function.
>
> Related Functions
>
> PROTECT.DOCUMENT Protects a sheet in a workbook
> List of Command-Equivalent Functions
>
> Hope this helps.
>
>
> Steve Dalton
>
>
>
> "Britta" wrote in message
> news:A5208E3C-56B7-4E81-97FF-3508E14F45B5@microsoft.com...
> > Dear all,
> >
> > I have a C-dll created with Excel developer's kit, that works fine with
> > previous versions of Excel. But switching to Excel 2007, I encountered the
> > following error:
> >
> > xlfGetFormula works fine as long as the sheet is not protected. As soon as
> > the sheet is protected and although the cell is not protected,
> > xlfGetFormula
> > crashes with a security violation error.
> >
> > Thank you very much for your help,
> >
> > Britta
>
>
>
date: Thu, 14 Aug 2008 22:18:00 -0700
author: Britta
|
|