[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I freeze panes in Excel using Delphi and OLE

Posted on 2010-09-01
9
Medium Priority
?
2,184 Views
Last Modified: 2012-05-10
I've got most of it (creating a excel sheet from Delphi) working but can't find the correct
 wording for freezing panes.

I'd also like to be able to use validation on cells.

Is there a good resource that I can find this info for myself?
0
Comment
Question by:s_w_e2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 9

Expert Comment

by:javajws
ID: 33583542
0
 

Author Comment

by:s_w_e2
ID: 33583549
I'm not sure how to do the above solutions in Delphi.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:aflarin
ID: 33583878
>> Is there a good resource that I can find this info for myself?

At first you can import Excel library (Project -> Import Type Library -> Microsoft Excel Object Library)
Then you can look at the imported code and find things like consts, param counts etc

At the second you can use MSDN to find description of all Excel interfaces and objects. For example here is description of FormatConditions.Add method:

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.formatconditions.add(office.11).aspx
0
 
LVL 13

Accepted Solution

by:
aflarin earned 2000 total points
ID: 33583900
>> I'm not sure how to do the above solutions in Delphi.

procedure TForm1.Button1Click(Sender: TObject);
var
  XLApp: Variant;
begin
  XLApp:=CreateOLEObject('Excel.Application');
  XLApp.Visible:= True;
  XLApp.Range['A2:A2'].Select;
  XLApp.ActiveWindow.FreezePanes:= True;
end;
0
 
LVL 13

Expert Comment

by:aflarin
ID: 33583934
Validation:


procedure TForm1.Button1Click(Sender: TObject);
const
  xlValidateWholeNumber = $00000001;
  xlValidAlertInformation = $00000003;
  xlBetween = $00000001;
var
  XLApp: Variant;
  Validation: Variant;
begin
  XLApp:=CreateOLEObject('Excel.Application');
  XLApp.Visible:= True;
  Validation:= XLApp.Range['A1'].Validation;
  Validation.Add( xlValidateWholeNumber, xlValidAlertInformation, xlBetween, 5, 10 );
  Validation.InputTitle := 'Integers';
  Validation.ErrorTitle := 'Integers';
  Validation.InputMessage := 'Enter an integer from five to ten';
  Validation.ErrorMessage := 'You must enter a number from five to ten';
end;
0
 

Author Closing Comment

by:s_w_e2
ID: 33593353
Is there some source where I can find this info for myself?
0
 

Author Comment

by:s_w_e2
ID: 33593366
Sorry for the comment.  I'd missed your first reply.
0
 

Author Comment

by:s_w_e2
ID: 33593501
In the validation piece I needed to add
Validation.ShowError := True;
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question