Richard Stevens
Guest
|
Hi - using ADX 2008 Pro in Delphi 7, I want to be able to turn an Excel task pane on or off through a button on a toolbar. I can turn it off OK through its Enabled property, but turning it back on doesn't do anything.
eg,
ExcelTaskPaneManager.Items[0].Enabled := not ExcelTaskPaneManager.Items[0].Enabled;
works for turning panes off, but not on again.
When I encountered a similar problem in Outlook you pointed me towards the ApplyTo method, but I can't find an equivalent in Excel?
Many thanks,
Richard Stevens |
|
Fedor Shihantsov
Guest
|
Hello Richard,
Use the following code:
var
taskPane: TadxExcelTaskPane;
begin
adxExcelTaskPanesManager1.Items[0].Enabled := not adxExcelTaskPanesManager1.Items[0].Enabled;
if (adxExcelTaskPanesManager1.Items[0].Enabled) then begin
if adxExcelTaskPanesManager1.Items[0].TaskPaneInstance = nil then begin
taskPane := adxExcelTaskPanesManager1.Items[0].CreateTaskPaneInstance;
if (taskPane <> nil) then begin
taskPane.Show;
end;
end;
end;
end;
|
|
Richard Stevens
Guest
|
Thank you Fedor - that works perfectly.
Excellent support, as always.
Richard |
|