Advertisement

03.12.2008 at 10:35AM PDT, ID: 23235957
[x]
Attachment Details

My picture does not want to change for no reason...

Asked by touyets in Visual Basic Programming, VB Controls, VB Script

Tags: VBA, Excel 2003, Excel VBA

Ok, my problem is this:

I have an image on a userform called Image1 that does not want to change it's image1.picture property.

Attached is the code.

hat it does is this:

When I click on the picture when the form is loaded, it goes to excel and saves a chart into Mychart.jpg in C:\ and then changes the old image1.picture property by the new one but this is here it does not want to work....

Could you help?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Private Sub Image1_Click()
    Windows("Job Management.xls").Activate
    
    With Sheets("VBA")
    
    Dim mychart As Chart
      Set mychart = ActiveSheet.ChartObjects(1).Chart
      mychart.Export Filename:="c:\Mychart.jpg", FilterName:="jpg"
         
    End With
    
    Image1.Picture = LoadPicture("c:\Mychart.jpg")
    
    
End Sub
[+][-]03.12.2008 at 10:43AM PDT, ID: 21108691

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 10:45AM PDT, ID: 21108717

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 10:54AM PDT, ID: 21108827

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, VB Controls, VB Script
Tags: VBA, Excel 2003, Excel VBA
Sign Up Now!
Solution Provided By: touyets
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628