Excel to PDF

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaiful
    New Member
    • Oct 2007
    • 89

    Excel to PDF

    Hi all, I have a problem to convert PDF from excel file, i have installed PDF printer and i can make PDF file from excel by manually, I want to make it programetically in VB6. i made a set of code which is working but it sending to Physical printer printer directly, the code

    Dim xlapp As excel.Applicati on
    Dim xlbook As excel.WorkBook
    Dim xlsheet As excel.WorkSheet

    Set xlbook = GetObject("d:\T EST.xls")
    Set xlapp = xlbook.Parent
    xlapp.Visible = True
    xlapp.Windows(" TEST.XLS").Visi ble = True
    Set xlsheet = xlbook.Sheets(" Sheet1")
    xlsheet.PrintOu t , , 1, , "\\server\A DOB PDF"

    Pls give me advice where i did mistake, thx advance 4 ur time.
  • vikas000000a
    New Member
    • Jan 2008
    • 46

    #2
    Originally posted by shaiful
    Hi all, I have a problem to convert PDF from excel file, i have installed PDF printer and i can make PDF file from excel by manually, I want to make it programetically in VB6. i made a set of code which is working but it sending to Physical printer printer directly, the code

    Dim xlapp As excel.Applicati on
    Dim xlbook As excel.WorkBook
    Dim xlsheet As excel.WorkSheet

    Set xlbook = GetObject("d:\T EST.xls")
    Set xlapp = xlbook.Parent
    xlapp.Visible = True
    xlapp.Windows(" TEST.XLS").Visi ble = True
    Set xlsheet = xlbook.Sheets(" Sheet1")
    xlsheet.PrintOu t , , 1, , "\\server\A DOB PDF"

    Pls give me advice where i did mistake, thx advance 4 ur time.

    Make the PDF printer as the default printer of your system.

    Check if the PDF printer you have installed provides any programmable objects. If so then add that to your references in your project and do it via this route.

    Comment

    • shaiful
      New Member
      • Oct 2007
      • 89

      #3
      Originally posted by vikas000000a
      Make the PDF printer as the default printer of your system.

      Check if the PDF printer you have installed provides any programmable objects. If so then add that to your references in your project and do it via this route.
      Actually, I have no idea that how to recognize the printer from network in VB6, if anybody help me to give some idea and which particular control or prefarence i sould use? Thx

      Comment

      • Dököll
        Recognized Expert Top Contributor
        • Nov 2006
        • 2379

        #4
        Originally posted by shaiful
        Actually, I have no idea that how to recognize the printer from network in VB6, if anybody help me to give some idea and which particular control or prefarence i sould use? Thx
        Hey shaiful!

        I think what vikas000000a is saying is the printer you normally print to is your default, you can go to Printes and Faxes through Control Panel and change the default to your PDF printer.

        I could me off base a bit...

        Try anyway see if that works:-)

        Comment

        • shaiful
          New Member
          • Oct 2007
          • 89

          #5
          Originally posted by Dököll
          Hey shaiful!

          I think what vikas000000a is saying is the printer you normally print to is your default, you can go to Printes and Faxes through Control Panel and change the default to your PDF printer.

          Try anyway see if that works:-)
          Hi I made PDF printer as a default printer. it is works. But i have many printer in my network and i need other printer as a default printer. Is there any way to select printer by code ? such as printer name =" \\server\PDF Printer", something like that, Thx again

          Comment

          Working...