Print Preview Option Getting Insufficient Memory Error : Help 追蹤

Legacy Poster

Hi,guys.  I tried to create a single button in excel to test command line access of bar tender

am on trial - 21 days left on Bartender 10.1 Enterprise Edition:


Sub Button1_Click()
   Set objShell = CreateObject("WScript.Shell")
   'objShell.Run """C:\Program Files\Seagull\BarTender Suite\bartend.exe"" /AF=""C:\Users\arturo.cantillep\Desktop\wafer3.btw"" /PD /X"
   objShell.Run """C:\Program Files\Seagull\BarTender Suite\bartend.exe"" /AF=""C:\Users\arturo.cantillep\Desktop\wafer3.btw"" /P /X"

End Sub


The /P option works without a hitch on the default HP printer....


The  /PD option however eat so much resource  cozing it to not work....


All im trying to give the user is a chance to see the image before it prints....


any solution ??


The excel file is the only one open and i made it so simple it uses only 1 button....


I would appreciate any help... work around.... use font for 2D instead on excel. is there such a font...

1 意見

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
  'Print with progress dialog
  'Call btFormat.PrintOut(True, False)
  'Show print dialog
  'Call btFormat.PrintOut(True, True)

  'Close BarTender
  btApp.Quit (btDoNotSaveChanges)

End Sub