Inserting Data without blank lines

H

Hacknwhack

This is probably something really simple, but here it is anyway.

I have a working macro to import numerous entries from a SQL database to
populate my project file. I loop thru my recordset doing a row insert with
each record until complete. The problem is that the insertions seem to
start at my current mouse position. For example with no data in the project
file whatsoever, if I were to click anywhere on the 10th row and them run
my macro, the first entry would be in the 10th line and I would end up with
9 blank lines.

I thought I had this beat with a;
SelectTaskField Row:=0, Column:="Name"
just before I begin my loop, but I was wrong.

Any suggestions.
Thanks
-hack
 
J

JackD

I'd avoid using SelectTaskField altogether. What is wrong with
activeproject.tasks.add(<name>, <position>)? Note that position is optional.
By default new tasks are at the end.
 
J

Jan De Messemaeker

Hi,
Jack is absolutely right, in Project VBA you do not think in terms or rows
and fields, but in terms of task or resource objects and their properties.
Still, should you insist, there is a method called SelectBeginning.
HTH
 
L

Lars Hammarberg

The method is relative to the row you're in - there's a third parameter
"RowRelative" that defaults to TRUE.
 

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