csv problem...

J

Joy

In ms project, we will export our ms project into a csv file and send the csv
file to server.
the code to put ms project content into csv file is:
Dim temp, export As String

Open GetTempDir & "\CPLMExport.csv" For Input As #1
While Not EOF(1)
Line Input #1, temp
export = export & HTTPSafeString(temp & vbCrLf)
Wend
Close #1

then export. I check that the csv file has no unit with it. it just has
numbers. like it does not read in '17d', but 17.

now, there is an issue that needs to be solved.

if go to tools->options->schedule, and change 'work is entered in':
days->hours
in csv file, it still shows numbers.

on the server side, this causes problem. how to put number+unit into csv
file???thanks

for example, in ms project, in the duration field, we have "136h", meaning
136 hours.
we export it, and in csv file, it shows: 136, but we want 136h

then in ms project, we use days instead of hours, in the duration field, we
have "17d", meaning 17 days.
we export it, and in csv file, it still shows: 17 ,but we want 17d
 
J

Jack Dahlgren MVP

where is the code for setting the value of "temp"?

Task.duration should always return time in minutes regardless of the
settings.

-Jack Dahlgren
 
J

Joy

for temp
Line Input #1, temp


read a line from ms project, and write to temp

I think you are right, but is there a way to check (whether days, mins, or
hrs, ..) and translate it to hrs before we put it into csv file?
 
J

Joy

btw, we do not use task.duration


Joy said:
for temp
Line Input #1, temp


read a line from ms project, and write to temp

I think you are right, but is there a way to check (whether days, mins, or
hrs, ..) and translate it to hrs before we put it into csv file?
 
J

Jack Dahlgren MVP

How are you reading the line from project?
Why not use task.duration?
From there you can easily convert into any unit (hour, day etc.)

-Jack Dahlgren
 

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