Help !

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hi,

This code works fine in VB6.0, but when used in a Access form, vbCFMetafile
is
becoming empty and raising a run-time error '424' (Object Required)

-----------------------------

Private Sub Command1_Click()

Dim wkb As Excel.Workbook

Set wkb = GetObject("d:\book6.xls")

wkb.Worksheets(1).Range("A1:C5").Copy

Image1.Picture = Clipboard.GetData(vbCFMetafile)

End Sub

Please help me !

Gary
 
My guess would be that 'vbCFMetafile' is a constant or enum that is defined
in the VB type library not in the VBA type library that VB and Access share.

If you find out the actual numerical value of the constant in VB
(Debug.Print vbCFMetafile) you could either use the literal value, or
declare it as a constant, or create your own Enum in VBA to mirror the VB
Enum.
 
Back
Top