home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 October / DPPCPRO1098.ISO / Ocx / VCFIMP / VCIMPRES.Z / CHSSLink.bas < prev    next >
Encoding:
BASIC Source File  |  1995-11-01  |  1.4 KB  |  60 lines

  1. Attribute VB_Name = "CommonCode"
  2. Option Explicit
  3.  
  4. Global GlobalObjID&
  5.  
  6. Sub ClearChartMenuChecks()
  7.  
  8.    MDIForm1.mnuChart2DBar.Checked = False
  9.    MDIForm1.mnuChart3DBar.Checked = False
  10.    MDIForm1.mnuChart2DPie.Checked = False
  11.    MDIForm1.mnuChart3DPie.Checked = False
  12.    
  13.    Call MoveChartPictureToSheet
  14.     
  15. End Sub
  16.  
  17. Sub MoveChartPictureToSheet()
  18.  
  19. #If Win32 Then
  20.    Dim metafile&
  21. #Else
  22.    Dim metafile%
  23. #End If
  24.  
  25.    Dim MapMode%, ObjID&
  26.    Dim X1!, Y1!, X2!, Y2!
  27.    Dim ExtentX&, ExtentY&
  28.    
  29.    ' If the chart is on the sheet then update it
  30.    If MDIForm1.chkLink.Value = 1 Then
  31.    
  32.       ' Get the metafile from the chart
  33.       ChartForm.VtChart1.GetMetafile VtPictureOptionNoSizeHeader, metafile, ExtentX, ExtentY
  34.    
  35.       ' Put metafile into existing object on sheet
  36.       MapMode = 8 ' Anisotropic Mode (Stretchable)
  37.       SheetForm.F1Book1.ObjSetPicture GlobalObjID, metafile, MapMode, ExtentX, ExtentY
  38.    
  39.    End If
  40.  
  41. End Sub
  42.  
  43. Sub ResizeArea()
  44.  
  45.    Dim Buffer$
  46.    
  47.    ' Get the last row and last column of the worksheet
  48.    ' and create a Formula One reference
  49.    With SheetForm.F1Book1
  50.       Let Buffer = "A1:" & .FormatRCNr(.LastRow, .LastCol, False)
  51.    End With
  52.    
  53.    ' Tell First Impression charting the worksheet, range, and parse method
  54.    ChartForm.VtChart1.SsLinkSheet = SheetForm.F1Book1.TableName
  55.    ChartForm.VtChart1.SsLinkRange = Buffer
  56.    ChartForm.VtChart1.SsLinkMode = VtChSsLinkModeAutoParse
  57.  
  58. End Sub
  59.  
  60.