Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Go Back  Xtreme Visual Basic Talk > > > Duplex Printing Excel Sheet from VB.Net


Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2013, 03:31 PM
ew03 ew03 is offline
Newcomer
 
Join Date: May 2013
Posts: 3
Default Duplex Printing Excel Sheet from VB.Net


Hi All,

I believe I have posted this thread in the correct place. I have a major problem to be solved. I have been develeoping excel automation application. Getting some inputs and combining with databases and writing all to the excel sheets. Up to this point everything goes smoothly. My problem arises when I want to print sheets from a printer which can duplex print. I have been searching forums and websites for weeks trying to find a feasible solution, and up to now It is all in vane. I have to print some sheets as simplex and some of them to be duplex. I tried setting duplex value of the printer from Printer.Settings by setting print.document to my workbook. I need a single tip or any suggestion to start working on the issue. I can print simplex sheets with no problem. However, I have no clue how to pirnt dublex. Many threads state it to be solved from Windows API or some modules to be used.
Please help me with this asmy hopes are melting away day by day.
Reply With Quote
  #2  
Old 05-18-2013, 04:16 PM
ew03 ew03 is offline
Newcomer
 
Join Date: May 2013
Posts: 3
Default

Code:
Imports Microsoft.Office.Interop
Imports System.Data.OleDb
Imports System.IO
Imports System.Security.Principal
Imports System.Drawing
Imports System.Drawing.Printing

Public Class Form9 
    Dim xlApp As Excel.Application = CreateObject("Excel.Application")
    Dim xlWorkBook As Excel.Workbook
    Dim xlWorkSheet As Excel.Worksheet
    Dim dir As String
    Public pd As PrintDocument

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        xlApp.Visible = True
        pd = New System.Drawing.Printing.PrintDocument
        With pd
            .DefaultPageSettings.PrinterSettings.Duplex =Printing.Duplex.Vertical
            .DocumentName = dir
        End With

        xlWorkBook = xlApp.Workbooks.Open(pd.DocumentName)
        xlWorkSheet = xlWorkBook.Worksheets("Template")
        xlWorkSheet.PrintPreview()
        xlWorkBook.Close()
        xlApp.Quit()

    End Sub

    Private Sub Form9_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        dir = Form_main.dir
    End Sub
End Class
I wrote above code and it was no luck any suggestions to improve this?
Reply With Quote
  #3  
Old 05-18-2013, 04:45 PM
ew03 ew03 is offline
Newcomer
 
Join Date: May 2013
Posts: 3
Default

Isn't there anyone to help? I believe this can be done and there are people who are able to do this in this forum.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
 
Duplex Printing Excel Sheet from VB.Net
Duplex Printing Excel Sheet from VB.Net
 
-->