Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Macro
Message
From
29/03/2000 11:33:37
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00352122
Message ID:
00352162
Views:
12
>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
Map
View

Click here to load this message in the networking platform