Mike - Here you go.
Here's some of the code in our system: tab2_macro = ssMacroName+"!Module3.Tab2" oExcel.WINDOWS(JUSTFNAME(ssName)).ACTIVATE oExcel.Sheets("Account Level").SELECT oExcel.RANGE("A2").SELECT
After the above code runs - then this is the call to the Macro: oExcel.APPLICATION.RUN(tab2_macro)
As you can - its loading data into the 2nd Tab of the spreadsheet. Hopefully this can help get you started!
Regards, Kurt Wendt Senior Systems Analyst
Tel. +1-212-747-9100 www.GlobeTax.com
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Wednesday, September 21, 2016 10:00 AM To: profoxtech@leafe.com Subject: RE: Trying to write Excel automation code in VFP9SP2 from Excel 2013 VBA macro code
On 2016-09-21 09:33, Kurt Wendt wrote:
I agree - that's what you should do. At my job here - there is a "Report" that's done the same way. Although strangely - the way they had it setup before I started on the system - is one spreadsheet that is the Template for the report. Then, another spreadsheet has the Macros that get called. Also, FYI - for this report - its 3 Tabs of data. A Stored Proc is called - that generates multiple sets of data - and then that data is used to populate the tabs in the Excel file. Somewhat similar to what you need to do...
Sounds exactly what I'm trying to do. So from VFP, open the Excel file (all via automation of course), then call the embedded macro with parms, right? How do you call a Macro via automation? I'll have to research it.
[excessive quoting removed by server]