+ Reply to Thread
Results 1 to 9 of 9

Export as picture

  1. #1
    Registered User
    Join Date
    08-09-2005
    Posts
    42

    Export as picture

    Hello,

    Is there any way how to export charts and selected areas in excel as picture.

    Thanks to all ...

    tommy

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Tommy,

    You can copy Charts and cells as pictures to the clipboard using the CopyPicture method for either one. Once its on the clipboard you can paste it or print it. Someone, I don't remember who, wrote some code to save the clipboard contents to a file as a bitmap image. Perhaps someone will know and post the link for you.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    08-09-2005
    Posts
    42

    save as picture

    yes I know that I can copy area but I want to write a macro which can save it as picture... is it possible?

    thanks...

    tommy

  4. #4
    Dave Peterson
    Guest

    Re: Export as picture

    Harald Staff's routine at David McRitchie's site:
    http://www.mvps.org/dmcritchie/excel/xl2gif.htm

    Should do what you want for the range.

    And look at .export in VBA's help for your charts.

    From the example in that Help text:

    Worksheets("Sheet1").ChartObjects(1).Chart.Export _
    FileName:="current_sales.gif", FilterName:="GIF"


    tommy_gtr wrote:
    >
    > Hello,
    >
    > Is there any way how to export charts and selected areas in excel as
    > picture.
    >
    > Thanks to all ...
    >
    > tommy
    >
    > --
    > tommy_gtr
    > ------------------------------------------------------------------------
    > tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
    > View this thread: http://www.excelforum.com/showthread...hreadid=479358


    --

    Dave Peterson

  5. #5
    Registered User
    Join Date
    08-09-2005
    Posts
    42

    XLS2GIF problem

    Hi Dave,

    Thank you for your answer.

    I found this solution but I have problem with it too.

    I write about it here
    http://www.excelforum.com/showthread...ghlight=export

    If you have a little free time, please have a look.

    Nice day

    tommy

  6. #6
    Dave Peterson
    Guest

    Re: Export as picture

    I don't open attachments.

    Maybe you could explain the problem in plain text.

    Or maybe someone will open your attachment and provide the answer you need.

    tommy_gtr wrote:
    >
    > Hi Dave,
    >
    > Thank you for your answer.
    >
    > I found this solution but I have problem with it too.
    >
    > I write about it here
    > http://www.excelforum.com/showthread...ghlight=export
    >
    > If you have a little free time, please have a look.
    >
    > Nice day
    >
    > tommy
    >
    > --
    > tommy_gtr
    > ------------------------------------------------------------------------
    > tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
    > View this thread: http://www.excelforum.com/showthread...hreadid=479358


    --

    Dave Peterson

  7. #7
    Registered User
    Join Date
    08-09-2005
    Posts
    42

    For Dave

    Hello,

    I understand that you don't want to open attachment and I thank you for your interest.

    I try to explain my problem with this code, but I think there is no real solution.

    So when I use this macro on various sheets it work very good and I'm happy for that. but problem is that when i use it in one special sheet in my project it doesn't work. The select range dialog appears, then I select some range and then I click ok. and that's all .... no save as dialog will appear.

    I tried to run this macro through steps in VB editor.
    I think that the problem is somewhere in this function:

    Function SelectArea() As String
    Dim Internrange As Range
    On Error GoTo Brutt
    Set Internrange = Application.InputBox("Select " _
    & "range to be photographed:", "Picture Selection", _
    Selection.AddressLocal, Type:=8)
    SelectArea = Internrange.Address
    Exit Function
    Brutt:
    SelectArea = "A1"
    End Function


    cause it jump over the line with "SelectArea = Internrange.Address" straight to "SelectArea = "A1".

    I dont know why ....

    On any other sheet it works fine...

    I found that when I change a width of some column that on some places in sheet it works.

    May it be caused by some limitation of excel ????

    Thanks for your answer....

    tommy

  8. #8
    Dave Peterson
    Guest

    Re: Export as picture

    I don't see anything in that function that would cause the error.

    Are you sure you clicked the ok button?

    You could comment that "on error goto Brutt" line while you're testing.

    And a cursory glance at Harald's code looks like he expects that range to be on
    the activesheet. Did you activate the sheet before you chose the range?



    tommy_gtr wrote:
    >
    > Hello,
    >
    > I understand that you don't want to open attachment and I thank you for
    > your interest.
    >
    > I try to explain my problem with this code, but I think there is no
    > real solution.
    >
    > So when I use this macro on various sheets it work very good and I'm
    > happy for that. but problem is that when i use it in one special sheet
    > in my project it doesn't work. The select range dialog appears, then I
    > select some range and then I click ok. and that's all .... no save as
    > dialog will appear.
    >
    > I tried to run this macro through steps in VB editor.
    > I think that the problem is somewhere in this function:
    >
    > Function SelectArea() As String
    > Dim Internrange As Range
    > On Error GoTo Brutt
    > Set Internrange = Application.InputBox("Select " _
    > & "range to be photographed:", "Picture Selection", _
    > Selection.AddressLocal, Type:=8)
    > SelectArea = Internrange.Address
    > Exit Function
    > Brutt:
    > SelectArea = "A1"
    > End Function
    >
    > cause it jump over the line with "SelectArea = Internrange.Address"
    > straight to "SelectArea = "A1".
    >
    > I dont know why ....
    >
    > On any other sheet it works fine...
    >
    > I found that when I change a width of some column that on some places
    > in sheet it works.
    >
    > May it be caused by some limitation of excel ????
    >
    > Thanks for your answer....
    >
    > tommy
    >
    > --
    > tommy_gtr
    > ------------------------------------------------------------------------
    > tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
    > View this thread: http://www.excelforum.com/showthread...hreadid=479358


    --

    Dave Peterson

  9. #9
    Dave Peterson
    Guest

    Re: Export as picture

    I don't see anything in that function that would cause the error.

    Are you sure you clicked the ok button?

    You could comment that "on error goto Brutt" line while you're testing.

    And a cursory glance at Harald's code looks like he expects that range to be on
    the activesheet. Did you activate the sheet before you chose the range?



    tommy_gtr wrote:
    >
    > Hello,
    >
    > I understand that you don't want to open attachment and I thank you for
    > your interest.
    >
    > I try to explain my problem with this code, but I think there is no
    > real solution.
    >
    > So when I use this macro on various sheets it work very good and I'm
    > happy for that. but problem is that when i use it in one special sheet
    > in my project it doesn't work. The select range dialog appears, then I
    > select some range and then I click ok. and that's all .... no save as
    > dialog will appear.
    >
    > I tried to run this macro through steps in VB editor.
    > I think that the problem is somewhere in this function:
    >
    > Function SelectArea() As String
    > Dim Internrange As Range
    > On Error GoTo Brutt
    > Set Internrange = Application.InputBox("Select " _
    > & "range to be photographed:", "Picture Selection", _
    > Selection.AddressLocal, Type:=8)
    > SelectArea = Internrange.Address
    > Exit Function
    > Brutt:
    > SelectArea = "A1"
    > End Function
    >
    > cause it jump over the line with "SelectArea = Internrange.Address"
    > straight to "SelectArea = "A1".
    >
    > I dont know why ....
    >
    > On any other sheet it works fine...
    >
    > I found that when I change a width of some column that on some places
    > in sheet it works.
    >
    > May it be caused by some limitation of excel ????
    >
    > Thanks for your answer....
    >
    > tommy
    >
    > --
    > tommy_gtr
    > ------------------------------------------------------------------------
    > tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
    > View this thread: http://www.excelforum.com/showthread...hreadid=479358


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1