Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Inserting a picture that is embedded in an Access Report

I have been updating an Access database that contains an embedded logo in a
report. The owner of the database asked me if it would be possible to export
the Report to Excel in a manner that maintained the formatting and layout of
the report (Access' current Export to Excel simply outputs the recordset,
dropping any formatting). I've come up with a workaround for all of the
information within a report except for an embedded image. I can place the
image into a spreadsheet using code if it has a static path, or by promting
the user for a path EVERY time they export, but this is less than ideal. I'm
not terribly familliar with the vba that Excel uses, and have only been able
to get this far (code is in an Access Event):

Dim xlApp as Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim imgPic as Image

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
Set imgPic = Reports!rptMyReport!Controls!imgLogo

With xlBook.ActiveSheet.Range("a1")
Set myPict = .Parent.Pictures.Insert(imgPic)
End With

This returns Run-Time error 1004: Unable to get the insert property of the
Pictures class.

If I put in a static pathname instead of the imgPic object or use code to
prompt the user for the image location, all's well, but
for my purposes, this will not work. Excel's vba help file is less than
helpful on this matter.

Does anybody have any ideas they'd mind throwing at me?

Thanks in advance,
Tim

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
Inserting a Picture using Cell as picture name. the-jackal Links and Linking in Excel 12 November 10th 08 09:21 AM
Picture embedded in data row helen Excel Discussion (Misc queries) 1 January 21st 07 08:18 AM
embedded picture in excel KalpeshPatel Excel Discussion (Misc queries) 0 October 23rd 06 11:25 PM
get a picture width and height without inserting the picture Dorothy Excel Programming 1 January 13th 05 05:06 AM
inserting a picture from an excel file into an access table [email protected] Excel Programming 0 June 24th 04 10:05 AM


All times are GMT +1. The time now is 01:29 AM.

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"