Really impressive work!  I was able to test a little on Friday and I
have to tell you that at first glance the new instance of excel seemed
to work(windows + R).  I was able to start the refresh on one report..
then open a new instance and start the refresh on a second.  The real
test will be on Monday with the big update.

Now if I understand some of the other suggestions I have a new thought
which is that I could schedule a task, or several tasks to autorun
these reports.  Does the code below look correct?  I am unfortunatly
at my mother-in-law's and am not able to give this the best proofing
now.  Hemant this is also the script you were asking for but again I
have it set to use outlook.

Did you mean to use this a Wshell script or just use within excel
macro?

Sub Testholsten()
Dim X As Object
Set X = CreateObject("excel.application")
X.Workbooks.Add
'X.Visible = True
'-------------------------------
' refresh data connections then save as and email
' REMEMBER TO DESELECT "BACKGROUND REFRESH" ON LINKED TABLE
' DATA-OPTIONS-CONNECTIONS-USAGE TAB
 DoEvents
    ActiveWorkbook.RefreshAll
    ChDir "insertyourpathhere"
    ActiveWorkbook.Saveas Filename:= _
        "insertpathandfilenamehere" & Format(Date, "dd-mm-yy"), _
        FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
        ReadOnlyRecommended:=False, CreateBackup:=False
    Dim OutApp As Object
    Dim OutMail As Object

    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)

    On Error Resume Next
    With OutMail
        .To = "yourem...@email.com"
        .CC = ""
        .BCC = ""
        .Subject = "Auto Email Test"
        .Body = "i hope this works"
        .Attachments.Add ActiveWorkbook.FullName
        'You can add other files also like this
        '.Attachments.Add ("C:\test.txt")
        .Send   'or use .Display
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
X.ActiveWorkbook.ActiveSheet.Cells(1, 1) = "It works!"
'-------------------------------
'I DO NOT KNOW THAT I NEED THIS PART BECAUSE IT IS ALREADY INCLUDED
ABOVE...CONFIRM?
X.DisplayAlerts = False
X.ActiveWorkbook.SaveAs "C:\temp.xls"
X.DisplayAlerts = True
X.Quit
Set X = Nothing
End Sub


Sometimes I read through here and the brilliance of you folks makes me
feel like a rookie....

Thanks again!!

On Oct 24, 6:12 am, Hemant Hegde <hemantbales...@gmail.com> wrote:
> Hi Holsten and Rolf
>
> You can create a new instance of an excel application with this code
>
> Sub Test()
> Dim X As Object
> Set X = CreateObject("excel.application")
> X.Workbooks.Add
> 'X.Visible = True
> '-------------------------------
> 'Your code here..
> X.ActiveWorkbook.ActiveSheet.Cells(1, 1) = "It works!"
> '-------------------------------
> X.DisplayAlerts = False
> X.ActiveWorkbook.SaveAs "C:\temp.xls"
> X.DisplayAlerts = True
> X.Quit
> Set X = Nothing
> End Sub
>
> --
> Hemant Hegde

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to