Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-23-2015, 06:44 AM   #1
adh123
Newly Registered User
 
Join Date: Jan 2015
Posts: 77
Thanks: 20
Thanked 2 Times in 2 Posts
adh123 is on a distinguished road
Export image to Excel and resize

Hopefully a very simple fix...

Code:
Dim db As DAO.Database
Dim strDBPath As String
Dim strPictureName As String

Dim obExcel As Object

Set db = CurrentDb()

Set obExcel = CreateObject("Excel.Application")

strDBPath = CurrentProject.Path & "\"
strPictureName = "logo.png"

If Me.chkFullQuote.Value = 0 And Me.chkSimpleQuote.Value = 0 Then
    MsgBox "Please select quote type"
    Exit Sub
    Else
    End If

If Me.chkFullQuote.Value = -1 Then

    MsgBox "logo = " & strDBPath & strPictureName

    With obExcel
        .workbooks.Add

        'Incase sheet does not exist
        On Error Resume Next

        .Sheets("Sheet2").Delete
        .Sheets("Sheet3").Delete

        With obExcel
            If .activesheet.Name = "Sheet1" Then
                .activesheet.Name = strSheet_Name
               
                .activesheet.cells(1, 4).Select
                .activesheet.pictures.Insert (strDBPath & strPictureName)
Is there any way to re-size the image or to fit it in right hand corner of the excel page (i.e. company logo in top right corner)? Other than re-sizing the columns and inserting into a specific cell to get it close-ish to the top right I am not having much joy (especially in re-sizing!).

adh123 is offline   Reply With Quote
Old 12-23-2015, 07:09 AM   #2
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 3,211
Thanks: 83
Thanked 457 Times in 413 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Re: Export image to Excel and resize

THIS sounds like it may be what you're looking for.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Frothingslosh is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help Resize image haithemelkhier Modules & VBA 2 05-18-2012 12:22 AM
Resize image box on rpt oxicottin Reports 10 08-31-2010 10:49 AM
Auto Resize Button Image djwasim Forms 3 07-12-2010 02:57 AM
Resize and Center Image Frame ssteinke Sample Databases 3 07-06-2006 02:45 PM




All times are GMT -8. The time now is 01:52 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World