Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copy image from existing workbook / template

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy image from existing workbook / template

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copy image from existing workbook / template

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
How do I apply a template to one worksheet in existing workbook? Gwen Excel Discussion (Misc queries) 0 June 19th 07 02:55 PM
Need to insert a template with formulas into an existing workbook Benny Excel Worksheet Functions 1 September 6th 06 10:37 PM
Copy Sheet from One workbook to another EXISTING workbook Ken Soenen Excel Programming 0 February 12th 06 04:07 PM
Can you apply a template to an existing Workbook? Bruce E. Stemplewski Excel Programming 1 December 26th 04 01:28 AM


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"