Excel Workbook creation using C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prisy

    Excel Workbook creation using C#

    I'm creating an excel workbook using c#. At this line of code I get an error:

    excelWorksheet. PageSetup.pLeft Header = "Name \n" + "Record# \n" + "ID# \n" +
    "Date \n" + "Range \n";

    The error I get is:

    "No printers are installed. To install a printer, point to Settings on the
    Windows Start menu, click Printers, and then double-click Add Printer. Follow
    the instructions in the wizard."

    I've checked to see whether I have a printer installed and I do. Can someone
    please help me?


    Thanks
    Prisy
  • Willy Denoyette [MVP]

    #2
    Re: Excel Workbook creation using C#


    "Prisy" <Prisy@discussi ons.microsoft.c om> wrote in message
    news:DB4066A6-B1B1-4977-AD9F-258A8CC12A38@mi crosoft.com...[color=blue]
    > I'm creating an excel workbook using c#. At this line of code I get an
    > error:
    >
    > excelWorksheet. PageSetup.pLeft Header = "Name \n" + "Record# \n" + "ID# \n"
    > +
    > "Date \n" + "Range \n";
    >
    > The error I get is:
    >
    > "No printers are installed. To install a printer, point to Settings on the
    > Windows Start menu, click Printers, and then double-click Add Printer.
    > Follow
    > the instructions in the wizard."
    >
    > I've checked to see whether I have a printer installed and I do. Can
    > someone
    > please help me?
    >
    >
    > Thanks
    > Prisy[/color]

    Is this a windows or console application, or is it a Service style
    application? (Windows Service, Web application).
    If it's the latter, then this behavior is by design, if it's the former
    (less likely), one possible reason could be impersonation of a non
    interactive account.

    Willy.



    Comment

    • Prisy

      #3
      Re: Excel Workbook creation using C#

      This is a web application. Why do you say it is by design? Do you know of any
      Microsoft KnowledgeBase articles that mention this? What is a non interactive
      account? How can it be impersonated? Please explain.

      Another wierd thing about this is that even tho' this does not work on my
      machine, when I use Remote Desktop Connection from another machine and
      connect to my machine and then run it, it does not display this error but
      runs smoothly? Why would that happen?

      --
      Thanks in advance,
      Prisy


      "Willy Denoyette [MVP]" wrote:
      [color=blue]
      >
      > "Prisy" <Prisy@discussi ons.microsoft.c om> wrote in message
      > news:DB4066A6-B1B1-4977-AD9F-258A8CC12A38@mi crosoft.com...[color=green]
      > > I'm creating an excel workbook using c#. At this line of code I get an
      > > error:
      > >
      > > excelWorksheet. PageSetup.pLeft Header = "Name \n" + "Record# \n" + "ID# \n"
      > > +
      > > "Date \n" + "Range \n";
      > >
      > > The error I get is:
      > >
      > > "No printers are installed. To install a printer, point to Settings on the
      > > Windows Start menu, click Printers, and then double-click Add Printer.
      > > Follow
      > > the instructions in the wizard."
      > >
      > > I've checked to see whether I have a printer installed and I do. Can
      > > someone
      > > please help me?
      > >
      > >
      > > Thanks
      > > Prisy[/color]
      >
      > Is this a windows or console application, or is it a Service style
      > application? (Windows Service, Web application).
      > If it's the latter, then this behavior is by design, if it's the former
      > (less likely), one possible reason could be impersonation of a non
      > interactive account.
      >
      > Willy.
      >
      >
      >
      >[/color]

      Comment

      • Willy Denoyette [MVP]

        #4
        Re: Excel Workbook creation using C#


        "Prisy" <Prisy@discussi ons.microsoft.c om> wrote in message
        news:96718F35-6A10-48B7-BA08-DC5947A95A05@mi crosoft.com...[color=blue]
        > This is a web application. Why do you say it is by design? Do you know of
        > any
        > Microsoft KnowledgeBase articles that mention this? What is a non
        > interactive
        > account? How can it be impersonated? Please explain.
        >[/color]
        Check this, it answers all of your questions.

        [color=blue]
        > Another wierd thing about this is that even tho' this does not work on my
        > machine, when I use Remote Desktop Connection from another machine and
        > connect to my machine and then run it, it does not display this error but
        > runs smoothly? Why would that happen?
        >
        > --
        > Thanks in advance,
        > Prisy
        >
        >
        > "Willy Denoyette [MVP]" wrote:
        >[color=green]
        >>
        >> "Prisy" <Prisy@discussi ons.microsoft.c om> wrote in message
        >> news:DB4066A6-B1B1-4977-AD9F-258A8CC12A38@mi crosoft.com...[color=darkred]
        >> > I'm creating an excel workbook using c#. At this line of code I get an
        >> > error:
        >> >
        >> > excelWorksheet. PageSetup.pLeft Header = "Name \n" + "Record# \n" + "ID#
        >> > \n"
        >> > +
        >> > "Date \n" + "Range \n";
        >> >
        >> > The error I get is:
        >> >
        >> > "No printers are installed. To install a printer, point to Settings on
        >> > the
        >> > Windows Start menu, click Printers, and then double-click Add Printer.
        >> > Follow
        >> > the instructions in the wizard."
        >> >
        >> > I've checked to see whether I have a printer installed and I do. Can
        >> > someone
        >> > please help me?
        >> >
        >> >
        >> > Thanks
        >> > Prisy[/color]
        >>
        >> Is this a windows or console application, or is it a Service style
        >> application? (Windows Service, Web application).
        >> If it's the latter, then this behavior is by design, if it's the former
        >> (less likely), one possible reason could be impersonation of a non
        >> interactive account.
        >>
        >> Willy.
        >>
        >>
        >>
        >>[/color][/color]


        Comment

        Working...