Excel pop3 issue

  • Follow


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!


0
Reply SammyL 5/5/2010 6:53:51 PM

On May 5, 2:53=A0pm, SammyL <sam...@gmail.com> 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, =A0and 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 =3D 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 =3D 2
xlapp.ActiveSheet.PageSetup.Orientation =3D 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
0
Reply Tom 5/5/2010 8:15:55 PM


"SammyL" <sammyl@gmail.com> wrote in message 
news:009dd49c-d1f9-4e65-a09e-f4342f4379e4@v37g2000vbv.googlegroups.com...
> 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!
>
>Dear SammyL,
If you are doing an exlbook, you can do it in Microsoft Excel. By the way, 
if you skip creation of the macro that can be sent successfully, you can use 
a formatt text. Ifthat doesn't work, please E-Mail me at 2 addresses. 
LarsenK@verizon.net or kuhlpc#2@optimum.net.

From,
Kenny 


0
Reply Kenneth 7/28/2010 11:45:59 PM

2 Replies
321 Views

(page loaded in 0.115 seconds)

Similiar Articles:
















7/30/2012 12:31:45 PM


Reply: