General information
Category:
COM/DCOM and OLE Automation
>Exactly, That is why I created the macro using VBA so that Excel could format itself. The problem with the "Template" idea is that I'm not sure of a good way to load the data into an existing Excel sheet. If I use the "COPY TO... TYPE XL5" command it doesn't use any template it just copies the table/cursor element to element. Therefore the macro does not exist.
Create the macro in a workbook, save the workbook as an Add-In (.xla)
Menu:Tools, Item:Add-Ins..., use browse to find the Add-In you created, and add it to the list (ie: registered) then make sure it's checked (Loaded)
Now your function is essentially PART of the Excel application, independant of the spreadsheets. After the Copy To ... XL5, your automation only needs to run the macro. i'm not sure how to launch the macro from VFP though, can you call the procedure itself, or must you stuff the keyboard with the macro's accelerator? (make sure you assign the accelerator though the Tools/Macros/options dialog before you create the add-in. And don't lose the .xls because add-ins are compiled and can't be reedited)
BTW, you might want to have the macro check cells A1..?1 for the column names you expect to find, or something else to prevent the ever-present formatting macro from accidentally being launched by the user working on another document. (goof-proof your macro)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only