Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50165

How to update any already open Excel file ?

$
0
0
Hello,

I'm wondering on how I can always use the same Excel file to generate all my charts in different worksheets. Some time ago, the following code was doing waht I wnated to do from ms Access, but for an unknown reason, it doesn't work anymore.

Code:

Set xls = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
    Err.Clear
    Set xls = CreateObject("Excel.Application")
    xls.Workbooks.Add
End If

I don't understand. I'm dynamically call Excel to genarate all my charts. And once it's open, I want to reause the same file by adding more worksheets in it. Do you know any other way to do that ?

Viewing all articles
Browse latest Browse all 50165

Trending Articles