You cannot reference a variant array using a byte array even if the data contained within the variant array is all byte.
Suggest using Sub ConsumesByteArray(ByRef ByteArray) On Sep 7, 3:26 pm, ShayneH <shayne.hus...@gmail.com> wrote: > Is there a way to expose an array that is enclosed by a variant? > Basically I have one function that returns a variant type which needs > to be passed to another procedure that requires the parameter to be > typed as a byte array. > > eg: > Function UsuallyReturnsAnArray() As Variant > > the result, after testing to be an array is passed to: > > Sub ConsumesByteArray(ByRef ByteArray() As Byte) > > I need to find a way to coerce the variant that contains a byte array > returned from the first function to a byte array. > Copying each element to a dimensioned array is a possible solution, > but it seems to me there must be a way to reference the array that is > contained inside the variant type. > > Thanks in advance -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel