View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Alan[_2_] Alan[_2_] is offline
external usenet poster
 
Posts: 116
Default Importing an image in VBA

Since your path statement points to your local drive, it renders it useless
unless you have the path shared for all users.

If the two are kept in the same folder, use ThisWorkbook.Path or
ActiveWorkbook.Path to locate the picture file. You can send it as a zip
package to be unzipped into the same folder.

Or, you can store it in the workbook, hidden or otherwise.

Storing it on a network drive is the most convenient; if you have that
capability and everyone has access to a common drive. Everyone in my office
uses some of my modules which access logos and such on the network.

Regards,

Alan


"JacMar" wrote in message
...
Thanks Alan:

The difficulty is not to print the header only on the first page, it is
related to the fact that I will have a PICTURE as a Header. I am writing
a
macro, and I have taken care of the problem of not printing the headers on
every page. It is relatively easy to print different headers and footers
on
different pages, using VBA. I also know how to print a picture as a
header.
But the reference to that picture is of the form : "C:\. . . .jpg". This
means that if I move the Excel workbook, with the VBA code, to another
computer, it does not find the picture, unless I make sure to copy it in
the
required location on the new computer. I want to have the picture as part
of
the VBA code, if that is possible.

"Alan" wrote:

Unlike Word, Excel headers are placed on every sheet. This link might
help:

http://www.mcgimpsey.com/excel/subs/firstfooter.html

Regards,

Alan

"JacMar" wrote in message
...
Excel 2002. I need to insert a picture (logo) into a header, only on
the
first page of a printout. At the present time I am using in my VBA code
a
file reference for the picture, "c:\picture.jpg", for example. The
problem
is that when I transport the program on to another computer, the
reference
is
no longer valid. I know I can paste the picture onto a sheet, but how
do
I
then bring it back into a HEADER, for just one page? or is there
another
way
to do this?
Thanks in advance.