Hello,
Is there any way how to export charts and selected areas in excel as picture.
Thanks to all ...
tommy
Hello,
Is there any way how to export charts and selected areas in excel as picture.
Thanks to all ...
tommy
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
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
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
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
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
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
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks