I have created a program that creates an xml file which is "fully-compatible" with Excel (as compatible as an xml file can be, anyway). I now want to create a macro which creates a graph out of the information available. I know that xml files cannot carry VBA/macro information, so I've turned to creating an .xla file which runs whenever a file is opened with Excel and creates the graph. However, I am unable to make the .xla file run its macro at startup, even for .xls files.
The .xla is composed only of Module 1:
I am quite an amateur at VBA, so I wouldn't be at all surprised if this is completely wrong.
If I go into the VB Editor and click "Run Sub/UserForm," the above code works just fine. However, it doesn't run automatically, which, by my understanding, is what Workbook_Open() is supposed to do.
So I am merely asking if there's some mistake in my work and, as a tangential question, is there a way of attaching a macro or .xla to an .xml file so that the user doesn't need to install the .xla file in their Application Data?
I am using Windows and Office XP.
Thanks,
Wasabi
The .xla is composed only of Module 1:
Code:
Private Sub Workbook_Open()
With ActiveWorkbook
Range("A1:B9").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B9")
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
End With
End Sub
If I go into the VB Editor and click "Run Sub/UserForm," the above code works just fine. However, it doesn't run automatically, which, by my understanding, is what Workbook_Open() is supposed to do.
So I am merely asking if there's some mistake in my work and, as a tangential question, is there a way of attaching a macro or .xla to an .xml file so that the user doesn't need to install the .xla file in their Application Data?
I am using Windows and Office XP.
Thanks,
Wasabi
Last edited: