preview chart problem!

N

nebsrc

The code bellow will print preview all charts from active
sheet only if workbook is in exclusive mode (used by one
user).
Because i want to place my workbook onto network drive to
be used by students i need to set workbook to shared mode.
but in this case code will print preview the last chart
that has been previewed when in exclusive mode.
i inserted msgbox within for/next loop to get chart names
and indexes before preview and it displays corect names
but next line
mychart(x).chart.printpreview displays the last chart that
has been displayed when in exclusive mode.

please any help would be appriciated
thanks,

Private Sub cmd_Click()
Dim myChart As ChartObjects
Dim X As Integer
Dim ChartList As Integer
Dim nm As String, mi As Long
Dim i As Integer
ChartList = ActiveSheet.ChartObjects.Count
Set myChart = ActiveSheet.ChartObjects
For X = 1 To ChartList
nm = myChart(X).Chart.Name
'mi = myChart(x).Chart.Index
MsgBox "name is " & nm & " and index is " & mi
myChart(X).Chart.PrintPreview
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top