Windows Vista Forums

Excel pop3 issue

  1. #1


    SammyL Guest

    Excel pop3 issue

    Hi All,

    I am using a vbs to create an excel file from sql data, I then add and
    run a macro to format the excel, and then remove the macro using
    "xlbook.VBProject.VBComponents.Remove
    xlbook.VBProject.VBComponents("Module1") " in order to send the users
    a clean excel without the macro. When the user tries to download using
    pop3 it results in an error and the file cannot download. There seems
    to be something remaining in the file after removing the macro that is
    causing it to drive pop3 crazy. it seems that there is remnant of the
    macro after removal.

    If i skip creation of the macro i can send successfully, but the users
    need it formatted.

    I also tried formatting from vbs, such as
    xlapp.ActiveSheet.PageSetup.Orientation = xlapp.xlLandScape and keep
    getting an error that i cannot set the properties.
    Please help!



      My System SpecsSystem Spec

  2.   


  3. #2


    Tom Lavedas Guest

    Re: Excel pop3 issue

    On May 5, 2:53*pm, SammyL <sam...@newsgroup> wrote:

    > Hi All,
    >
    > I am using a vbs to create an excel file from sql data, I then add and
    > run a macro to format the excel, *and then remove the macro using
    > "xlbook.VBProject.VBComponents.Remove
    > xlbook.VBProject.VBComponents("Module1") " in order to send the users
    > a clean excel without the macro. When the user tries to download using
    > pop3 it results in an error and the file cannot download. There seems
    > to be something remaining in the file after removing the macro that is
    > causing it to drive pop3 crazy. it seems that there is remnant of the
    > macro after removal.
    >
    > If i skip creation of the macro i can send successfully, but the users
    > need it formatted.
    >
    > I also tried formatting from vbs, such as
    > xlapp.ActiveSheet.PageSetup.Orientation = xlapp.xlLandScape and keep
    > getting an error that i cannot set the properties.
    > Please help!
    The xLwhatever constants cannot be accessed (at least not easily) from
    a VBScript. Rather, their value needs to be hard coded into your
    script. For example, add the definition for the xlLandScape in your
    script and drop the object preface ...

    Const xlLandScape = 2
    xlapp.ActiveSheet.PageSetup.Orientation = xlLandScape

    Do similar for all of the other xl constants and your script should be
    able to do all of the formatting without resorting to calling an Excel
    macro.
    _____________________
    Tom Lavedas

      My System SpecsSystem Spec


Excel pop3 issue
Similar Threads
Thread Forum
running Excel Macro in in specified Excel files in spe PowerShell
Solution for stdole32 issue with excel and vista Vista General
How to view Excel document without Microsoft Office Excel installe Vista General
Vista ASP.NET 2.0 Cannot open Excel File using Microsoft.Excel 12.0 COM object Software
Outlook 2003 and Windows Mail POP3 issue Vista mail