Skip to main content

Search

Search

Print Preview Option Getting Insufficient Memory Error : Help

Comments

1 comment

  • Avatar
    Shotaro Ito

    To show preview dialog or print from Excel, try ActiveX.

    This sample demonstrates how to show print preview dialog.

     

    Note that this method is kind of slow to start if you print many documents - in such case you can load BarTender when Excel sheet open, and close at Excel sheet close.

    'Simple Excel VBA ActiveX Preview(with print button)
    'Add reference to BarTender 10.1 from VBA Tool > References
    Sub Button1_Click()
      
      Dim btApp As BarTender.Application
      Dim btFormat As BarTender.Format
      
      'Start BarTender
      Set btApp = New BarTender.Application
      
      'Show dialogs
      btApp.VisibleWindows = btInteractiveDialogs
      
      'Open document
      Set btFormat = btApp.Formats.Open(ActiveWorkbook.Path & "\test.btw")
       
      'Show preview dialog with toolbar
      btFormat.PrintPreview.ShowDialog
      
      'Print with progress dialog
      'Call btFormat.PrintOut(True, False)
      
      'Show print dialog
      'Call btFormat.PrintOut(True, True)
    
      'Close BarTender
      btApp.Quit (btDoNotSaveChanges)
    
    End Sub
    
    
    0

Please sign in to leave a comment.