PC Review


Reply
Thread Tools Rate Thread

Copy image from existing workbook / template

 
 
=?Utf-8?B?RGFuIEtlbGx5?=
Guest
Posts: n/a
 
      14th Mar 2007
We've just discovered a bug depending on whether Macro A or Macro has been
run on a workbook.

Macro A inserts an image from an original jpg on a network drive

Macro B inserts an image from an exisiting "template" in the workbook.

Whilst both images are the same (the image pasted in the template came from
the original jpg) the first Macro causes us problems when run a third macro
which reformats the workbook. If the source of the images on the workbook is
Macro A they get duplicated.

We want to rewrite the Macro to insert the images from a network copy of the
excel template - ideally without opening it.

Any suggestions?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      14th Mar 2007
I don't think you can grab an image from a closed workbook using existing VBA
properties and methods. Perhaps if you wrote code that can read the raw
compound document format and perhaps the BIFF format and extract and
interpret the sequence of bytes in the document that make up the image, you
could do that, but that would require many many lines of code and thorough
understanding of how the information is stored and how the data for an image
should be interpreted.

--
Regards,
Tom Ogilvy


"Dan Kelly" wrote:

> We've just discovered a bug depending on whether Macro A or Macro has been
> run on a workbook.
>
> Macro A inserts an image from an original jpg on a network drive
>
> Macro B inserts an image from an exisiting "template" in the workbook.
>
> Whilst both images are the same (the image pasted in the template came from
> the original jpg) the first Macro causes us problems when run a third macro
> which reformats the workbook. If the source of the images on the workbook is
> Macro A they get duplicated.
>
> We want to rewrite the Macro to insert the images from a network copy of the
> excel template - ideally without opening it.
>
> Any suggestions?

 
Reply With Quote
 
=?Utf-8?B?RGFuIEtlbGx5?=
Guest
Posts: n/a
 
      14th Mar 2007
In that case, is there any way I can "hide" the fact that I am opening up the
template in order to copy the image on it?

"Tom Ogilvy" wrote:

> I don't think you can grab an image from a closed workbook using existing VBA
> properties and methods. Perhaps if you wrote code that can read the raw
> compound document format and perhaps the BIFF format and extract and
> interpret the sequence of bytes in the document that make up the image, you
> could do that, but that would require many many lines of code and thorough
> understanding of how the information is stored and how the data for an image
> should be interpreted.
>
> --
> Regards,
> Tom Ogilvy
>
>
> "Dan Kelly" wrote:
>
> > We've just discovered a bug depending on whether Macro A or Macro has been
> > run on a workbook.
> >
> > Macro A inserts an image from an original jpg on a network drive
> >
> > Macro B inserts an image from an exisiting "template" in the workbook.
> >
> > Whilst both images are the same (the image pasted in the template came from
> > the original jpg) the first Macro causes us problems when run a third macro
> > which reformats the workbook. If the source of the images on the workbook is
> > Macro A they get duplicated.
> >
> > We want to rewrite the Macro to insert the images from a network copy of the
> > excel template - ideally without opening it.
> >
> > Any suggestions?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy data from a new workbook into an existing workbook Steve Weaver Microsoft Excel Discussion 0 3rd Aug 2009 11:03 AM
Copy data from one workbook to another existing workbook Mads Microsoft Excel Programming 3 17th Aug 2007 04:37 PM
Need to insert a template with formulas into an existing workbook =?Utf-8?B?QmVubnk=?= Microsoft Excel Worksheet Functions 2 6th Sep 2006 10:37 PM
Copy Sheet from One workbook to another EXISTING workbook Ken Soenen Microsoft Excel Programming 2 12th Feb 2006 04:07 PM
Can you apply a template to an existing Workbook? Bruce E. Stemplewski Microsoft Excel Programming 1 26th Dec 2004 01:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:22 AM.