Help !

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
 
B

Brendan Reynolds \(MVP\)

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.
 

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