Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default How to export chart to a network drive?

I tried to export a chart to a network drive but it appeared an error
said "object variable or withblock variable not set".
here is the code:
Private Sub Workbook_Deactivate()
Application.ActiveWorkbook.ActiveChart.Export Filename:="\\dc\youu
\MyChart.gif", _
FilterName:="GIF"
End Sub

I try to add the codes below at the beginning,but it appeared the same
error.
ChDir "\\dc\Operation\Store-Department"

can anyone tell me the reason? How to solve this problem?
Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default How to export chart to a network drive?

Maybe no chart is active ?

Tim


wrote in message
...
I tried to export a chart to a network drive but it appeared an error
said "object variable or withblock variable not set".
here is the code:
Private Sub Workbook_Deactivate()
Application.ActiveWorkbook.ActiveChart.Export Filename:="\\dc\youu
\MyChart.gif", _
FilterName:="GIF"
End Sub

I try to add the codes below at the beginning,but it appeared the same
error.
ChDir "\\dc\Operation\Store-Department"

can anyone tell me the reason? How to solve this problem?
Thank you



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default How to export chart to a network drive?

On Feb 26, 12:00*pm, "Tim Williams" <timjwilliams at gmail dot com
wrote:
Maybe no chart is active ?

Tim

wrote in message

...



I tried to export a chart to a network drive but it appeared an error
said "object variable or withblock variable not set".
here is the code:
Private Sub Workbook_Deactivate()
Application.ActiveWorkbook.ActiveChart.Export Filename:="\\dc\youu
\MyChart.gif", _
FilterName:="GIF"
End Sub


I try to add the codes below at the beginning,but it appeared the same
error.
ChDir "\\dc\Operation\Store-Department"


can anyone tell me the reason? How to solve this problem?
Thank you- Hide quoted text -


- Show quoted text -


haha, how stupid i am. you're right, no chart is active. so how can i
select/activate a certain chart to export if there are many charts in
a sheet?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default How to export chart to a network drive?

Find the name of the chartobject and use something like

with Activeworkbook.sheets("sheetname").Chartobjects("c hartname")
.Chart.Export Filename:="\\dc\youu\MyChart.gif", FilterName:="GIF"
end with

That's for a chart embedded on a worksheet - it's not clear from your post
whether you have that or a chartsheet....

Tim

wrote in message
...
On Feb 26, 12:00 pm, "Tim Williams" <timjwilliams at gmail dot com
wrote:
Maybe no chart is active ?

Tim

wrote in message

...



I tried to export a chart to a network drive but it appeared an error
said "object variable or withblock variable not set".
here is the code:
Private Sub Workbook_Deactivate()
Application.ActiveWorkbook.ActiveChart.Export Filename:="\\dc\youu
\MyChart.gif", _
FilterName:="GIF"
End Sub


I try to add the codes below at the beginning,but it appeared the same
error.
ChDir "\\dc\Operation\Store-Department"


can anyone tell me the reason? How to solve this problem?
Thank you- Hide quoted text -


- Show quoted text -


haha, how stupid i am. you're right, no chart is active. so how can i
select/activate a certain chart to export if there are many charts in
a sheet?


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
Network drive Greg Excel Worksheet Functions 1 January 13th 10 04:22 AM
Map Network Drive leerem Excel Discussion (Misc queries) 2 January 12th 09 07:11 PM
Using An Add-in On A Network Drive Using An Add-in On A Network Drive Excel Programming 5 June 15th 05 09:21 PM
Link workbooks-C drive to network drive Earl Excel Worksheet Functions 0 April 19th 05 05:50 PM
Userform Local Drive & Network drive question Joel Mills Excel Programming 3 December 29th 04 10:43 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"