Hi, > mode2.ptn = New UShort(mode1.num_ptn - 1) {} '<--- line causing Try: Redim mode.2ptn (mode1.num_ptn - 1) The C# -> VB translator didn't work correctly (which is very hard for this case). > Public Const HPDF_COMP_ALL As UInteger = 15 Try: Public Const HPDF_COMP_ALL As UInteger = 15UI This is a known bug. Rolf