cancel for cell with edit control

A

Albin

Hi,

What method can be used to deselect a task cell which has edit control?
Basically I want to do a cancel edit (Esc) if a cell has edit control. The
problem is if a cell has edit control it disables most of the
features/methods in ms project. Thanks in advance.

Regards,

Albin
 
J

John

Albin said:
Hi,

What method can be used to deselect a task cell which has edit control?
Basically I want to do a cancel edit (Esc) if a cell has edit control. The
problem is if a cell has edit control it disables most of the
features/methods in ms project. Thanks in advance.

Regards,

Albin

Albin,
Are you using VBA or something else? Whether or not a task field in the
current view is selected or not should have nothing to do with the
availability of project object methods/properties. In fact the most
efficient VBA code runs in the background, that is, it is independent of
what is displayed in the view.

John
Project MVP
 
A

Albin

Hi John,

I am using C# for Project 2003. The problem occurs when I try to modify the
Task Table in the Gantt View to show certain columns and tasks. The following
actions cannot be done when edit control is in a cell:

- insert a new column: ActiveProject.Application.TableEdit(...) and
ActiveProject.Application.TableApply(...).
- figure out if a column is present in the task table:
ActiveProject.Application.SelectTaskColumn(...)
- display the project summary task: ActiveProject.DisplayProjectSummaryTask
= true

Is there a way to do these actions in the background? If not possible, I
would like to remove the edit control from the cell somehow.

Albin
 
J

John

Albin said:
Hi John,

I am using C# for Project 2003. The problem occurs when I try to modify the
Task Table in the Gantt View to show certain columns and tasks. The following
actions cannot be done when edit control is in a cell:

- insert a new column: ActiveProject.Application.TableEdit(...) and
ActiveProject.Application.TableApply(...).
- figure out if a column is present in the task table:
ActiveProject.Application.SelectTaskColumn(...)
- display the project summary task: ActiveProject.DisplayProjectSummaryTask
= true

Is there a way to do these actions in the background? If not possible, I
would like to remove the edit control from the cell somehow.

Albin
Albin,
Sorry, I haven't worked with C#. I work exclusively with VBA. I
understand it is just as fast and a whole lot easier to work with.

I interpreted that what you meant by "edit control" was that a given
field cell was active - at least that what it means in VBA. Regardless
of what field cell is active, all of the methods you listed can be
performed with VBA. However, since they all deal with the active view,
they cannot be done using background processing.

I don't know if this helps much but it's the best I can offer. Maybe
someone with some C# experience can shed a little more light for you.

John
Project MVP
 
A

Albin

Hi,

That's a good idea. Is there a method that can displays the Task
Sheet/Table? I think that's the only way to guarantee nothing unexpected
happens on pressing Esc (my code runs when control is in the main window
without any forms/dialog-boxes).

Albin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top