Advertisement

08.07.2008 at 02:50AM PDT, ID: 23628725
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.7

Error printing excel file from VB6

Asked by Soutie in Visual Basic Programming

Tags:

Hi experts, I'm hoping someone can help me out with a particularly strange problem i have. a while ago I created a service using VB6 which runs in the background and creates reports using excel when a particular event is fired off, this works perfectly.  We now need to, aswel as save the excel file, print it automatically to the default printer on the machine.  When i step through the code everything runs perfectly and it saves and prints the excel file perfectly, but once compiled i get the following error in the event log (the service is configured to write to the event log)

"error 1004 - No printers are installed. to install a printer, point to settings on the windows startmenu, click printers and then double click add printer. Follow the instructions on the wizard."

the funny thing is that there are two Printers installed on this machine.

ill attach a code snippit of the offending part of code
is there anyway to force the service to pick up the printer to use of is it impossible to call the print function from within the service when it is compiled?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Dim xls2
Set xls2 = CreateObject("Excel.Application")
xls2.Workbooks.Open App.path & "\" & Report(n).TemplateName 'open the Report Template
 
xls2.Worksheets(1).Activate
 
'Code to fill data in the report here
 
xls2.DisplayAlerts = False
 
xls2.ActiveWorkbook.SaveAs Report(n).ReportsPath & Report(n).Reportname
 
If Report(n).Autoprint = "Yes" Or Report(n).Autoprint = "yes" Then
    xls2.Worksheets(1).PrintOut Copies:=1, ActivePrinter:=DefaultPrinter
End If
 
xls2.DisplayAlerts = True
xls2.ScreenUpdating = True
xls2.Application.Quit 'close excel without saving
Set xls2 = Nothing
[+][-]08.07.2008 at 03:20AM PDT, ID: 22179459

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 03:22AM PDT, ID: 22179474

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 04:00AM PDT, ID: 22179677

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 04:29AM PDT, ID: 22179833

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 04:37AM PDT, ID: 22179889

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 04:43AM PDT, ID: 22179930

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 05:21AM PDT, ID: 22180199

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 06:20AM PDT, ID: 22180615

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 06:45AM PDT, ID: 22180839

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 06:59AM PDT, ID: 22180977

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 07:03AM PDT, ID: 22181016

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: Visual basic 6
Sign Up Now!
Solution Provided By: jpaulino
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.07.2008 at 07:05AM PDT, ID: 22181033

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.07.2008 at 07:12AM PDT, ID: 22181115

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628