Export Gif/Bmp from MS Project 2003 to Excel

  • Thread starter sergio.f.r.silva
  • Start date
S

sergio.f.r.silva

Hello developers,


I'm recent developing VB macro to export my Project to Excel. My
experience on this matter is quite low but i already learned some
basic things. My macro already export my Project Tasks to Excel but i
would like put a picture (already measured) in my excel sheet (logo
from company).

1 - Can i add that picture to Project and Export as well with my data?
If yes, how?
2 - If i can't add picture to Project, how do I send Picture to Excel
giving "FilePath as String"?

I can always make 1 macro at excel to insert picture but i want to
avoid this situation.


Thx for help,

Sérgio Silva
 
R

Rod Gill

Try recording a macro in Excel of you importing the image from a file then
copying that code to Project. You will need to modify the code a little by
adding the Excel Application Object you created to talk with Excel.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com



Hello developers,


I'm recent developing VB macro to export my Project to Excel. My
experience on this matter is quite low but i already learned some
basic things. My macro already export my Project Tasks to Excel but i
would like put a picture (already measured) in my excel sheet (logo
from company).

1 - Can i add that picture to Project and Export as well with my data?
If yes, how?
2 - If i can't add picture to Project, how do I send Picture to Excel
giving "FilePath as String"?

I can always make 1 macro at excel to insert picture but i want to
avoid this situation.


Thx for help,

Sérgio Silva
 
S

sergio.f.r.silva82

Try recording a macro in Excel of you importing the image from a file then
copying that code to Project. You will need to modify the code a little by
adding the Excel Application Object you created to talk with Excel.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:http://www.projectvbabook.com


Hello developers,

I'm recent developing VB macro to export my Project to Excel. My
experience on this matter is quite low but i already learned some
basic things. My macro already export my Project Tasks to Excel but i
would like put a picture (already measured) in my excel sheet (logo
from company).

1 - Can i add that picture to Project and Export as well with my data?
If yes, how?
2 - If i can't add picture to Project, how do I send Picture to Excel
giving "FilePath as String"?

I can always make 1 macro at excel to insert picture but i want to
avoid this situation.

Thx for help,

Sérgio Silva

Rod Gill,

I did it, but there is an issue i would like to avoid. I would like to
know if there is a way to attach image to project. This is useful
because i need to pass the project file to Client and i would not need
to pass him the image file as well.
I can attach an object to Task notes (text, picture, ...) but when i
want to insert picture at excel the method "Picture.Insert" need a
String. How can i Cast or export the Object (my Image) in 1 Task to
excel? If i write a text in Project Summary Task Notes i can get it by
"ActiveProject.ProjectSummaryTask.Notes" but i don't know how to get
the Object(Image) and export to Excel.

Thx for your help,

Sérgio Silva
 
R

Rod Gill

I can't find an Object save method of any form, so I suspect you are out of
luck.

I would distribute the file with the project file in a zip file. Get the
user to extract both files to the same folder, then you can tell Excel where
it is.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com



Try recording a macro in Excel of you importing the image from a file then
copying that code to Project. You will need to modify the code a little by
adding the Excel Application Object you created to talk with Excel.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:http://www.projectvbabook.com


Hello developers,

I'm recent developing VB macro to export my Project to Excel. My
experience on this matter is quite low but i already learned some
basic things. My macro already export my Project Tasks to Excel but i
would like put a picture (already measured) in my excel sheet (logo
from company).

1 - Can i add that picture to Project and Export as well with my data?
If yes, how?
2 - If i can't add picture to Project, how do I send Picture to Excel
giving "FilePath as String"?

I can always make 1 macro at excel to insert picture but i want to
avoid this situation.

Thx for help,

Sérgio Silva

Rod Gill,

I did it, but there is an issue i would like to avoid. I would like to
know if there is a way to attach image to project. This is useful
because i need to pass the project file to Client and i would not need
to pass him the image file as well.
I can attach an object to Task notes (text, picture, ...) but when i
want to insert picture at excel the method "Picture.Insert" need a
String. How can i Cast or export the Object (my Image) in 1 Task to
excel? If i write a text in Project Summary Task Notes i can get it by
"ActiveProject.ProjectSummaryTask.Notes" but i don't know how to get
the Object(Image) and export to Excel.

Thx for your help,

Sérgio Silva
 
M

Mask

I can't find an Object save method of any form, so I suspect you are out of
luck.

I would distribute the file with the project file in a zip file. Get the
user to extract both files to the same folder, then you can tell Excel where
it is.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:http://www.projectvbabook.com












Rod Gill,

I did it, but there is an issue i would like to avoid. I would like to
know if there is a way to attach image to project. This is useful
because i need to pass the project file to Client and i would not need
to pass him the image file as well.
I can attach an object to Task notes (text, picture, ...) but when i
want to insert picture at excel the method "Picture.Insert" need a
String. How can i Cast or export the Object (my Image) in 1 Task to
excel? If i write a text in Project Summary Task Notes i can get it by
"ActiveProject.ProjectSummaryTask.Notes" but i don't know how to get
the Object(Image) and export to Excel.

Thx for your help,

Sérgio Silva- Ocultar texto citado -

- Mostrar texto citado -

Thx for your expended time,

Sérgio Silva
 
M

Mask

Thx for your expended time,

Sérgio Silva- Ocultar texto citado -

- Mostrar texto citado -

Rod Gill,

Is there any way to open an image there is located in project folder
passing only the name of image instead all path?
This is useful because like that I don't need to change path to image
wherever he is located as long the image is at project folder.

Thx once again,

Mask
 
M

Mask

I got it.

Quite easy.

Dim Image as String
Image = ActiveProject.Path & "image.gif"

xl.Range("A1").Select
xl.ActiveSheet.Pictures.Insert(Image).Selection
 
M

Mask

Correction:

Dim Image as String
Image = ActiveProject.Path & "\image.gif"

xl.Range("A1").Select
xl.ActiveSheet.Pictures.Insert(Image).Selection
 

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