lundi 20 avril 2015

Run a macro inside to an excel file without opening excel program [on hold]

I have an excel consists of 10 sheets.

Each sheet uses XML feed data connections as tables.

Inside there is a macro - to update the XML databinding and to remove duplicate items.

But, because of size and processing problems it's becoming very difficult for me to keep open excel file always.

I have googled as much as possible but confused all the way!

Can any one help me "how to run update macro inside my excel" from any where with some simple command like CMD - run command.

I don't mind whether it is C#, .Net (sorry for third party tools)!

Thanks for your time and efforts!

I am sorry to hear this "my question is very broad!"

But unfortunately, I didn't find any starting clue to step on re-search about it's solution to get on my own. Also, I don't have enough knowledge in programming.

I have this code in my excel sheet.

Sub Macro_Refresh()
Dim ws As worksheet
Dim xmltable As ListObject
ActiveWorkbook.RefreshAll
alertTime = Now + TimeValue("00:30:00")
Appication.OnTime alertTime, "Macro_Refresh"
For Each ws In ThisWorkbook.Worksheets
    If ws.ListObjects.Count <> 0 Then
        Set  xmltable = ws.ListObjects(1)
        xmltable.Range.RemoveDuplicates Columns:=Array(4), Header:=xlYes
    End If
Next ws
End sub

I want to run this macro which is inside to excel file - without opening the excel file.

Aucun commentaire:

Enregistrer un commentaire