By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,044 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,044 IT Pros & Developers. It's quick & easy.

Excel to PDF

P: 89
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.Application
Dim xlbook As excel.WorkBook
Dim xlsheet As excel.WorkSheet

Set xlbook = GetObject("d:\TEST.xls")
Set xlapp = xlbook.Parent
xlapp.Visible = True
xlapp.Windows("TEST.XLS").Visible = True
Set xlsheet = xlbook.Sheets("Sheet1")
xlsheet.PrintOut , , 1, , "\\server\ADOB PDF"

Pls give me advice where i did mistake, thx advance 4 ur time.
Jan 7 '08 #1
Share this Question
Share on Google+
4 Replies


P: 46
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.Application
Dim xlbook As excel.WorkBook
Dim xlsheet As excel.WorkSheet

Set xlbook = GetObject("d:\TEST.xls")
Set xlapp = xlbook.Parent
xlapp.Visible = True
xlapp.Windows("TEST.XLS").Visible = True
Set xlsheet = xlbook.Sheets("Sheet1")
xlsheet.PrintOut , , 1, , "\\server\ADOB 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.
Jan 7 '08 #2

P: 89
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
Jan 7 '08 #3

Dököll
Expert 100+
P: 2,364
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:-)
Jan 8 '08 #4

P: 89
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
Jan 14 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.