|
|
| Excel header/footer fonts and automation |
|
| Author |
Message |
ChancreSore02

|
Posted: Visual FoxPro General, Excel header/footer fonts and automation |
Top |
Hi, I did a search but didn't see this topic brought up.
I want to change the font of my header in Excel (ver 11) using Visual Foxpro (ver 9). I used the macro recorder in excel to get a general idea, but I can't seem to get the code to work in VFP.
Here's the excel code:
ActiveSheet.PageSetup.LeftHeader = "&""Arial,Regular""2nd QTR 2006 vs 2nd QTR 2005"
How do I get that code to work in Fox
Any help would be much appreciated!
Jeff
Visual FoxPro2
|
| |
|
| |
 |
AnnyJacky

|
Posted: Visual FoxPro General, Excel header/footer fonts and automation |
Top |
XLApp = tmpsheet. Application
XLApp.WorkBooks. Add()
xlsheet = XLApp.ActiveSheet
xlsheet.PageSetup.LeftFooter = "-Footer here--"
|
| |
|
| |
 |
ChancreSore02

|
Posted: Visual FoxPro General, Excel header/footer fonts and automation |
Top |
Right, I got that part. I'm just not sure how to change the font.
|
| |
|
| |
 |
Alex Feldstein

|
Posted: Visual FoxPro General, Excel header/footer fonts and automation |
Top |
>Here's the excel code: >ActiveSheet.PageSetup.LeftHeader = "&""Arial,Regular""2nd QTR 2006 vs 2nd QTR 2005" >How do I get that code to work in Fox
Try:
ActiveSheet.PageSetup.LeftHeader = [&"Arial,Regular"2nd QTR 2006 vs 2nd QTR 2005]
|
| |
|
| |
 |
ChancreSore02

|
Posted: Visual FoxPro General, Excel header/footer fonts and automation |
Top |
Alex Feldstein wrote: | >Here's the excel code: >ActiveSheet.PageSetup.LeftHeader = "&""Arial,Regular""2nd QTR 2006 vs 2nd QTR 2005" >How do I get that code to work in Fox
Try:
ActiveSheet.PageSetup.LeftHeader = [&"Arial,Regular"2nd QTR 2006 vs 2nd QTR 2005]
|
|
Excellent, that worked! However, I'm not sure how you make that work with a variable as opposed to actual text. That is: ActiveSheet.PageSetup.LeftHeader = [&"Arial,Regular"lcLeftHeader]
That puts "lcLeftHeader" in the header, as opposed to the value I assigned to it.
Any suggestions
Thanks,
Jeff
|
| |
|
| |
 |
CetinBasoz

|
Posted: Visual FoxPro General, Excel header/footer fonts and automation |
Top |
ActiveSheet.PageSetup.LeftHeader = [&"Arial,Regular"]+m.lcLeftHeader
|
| |
|
| |
 |
ChancreSore02

|
Posted: Visual FoxPro General, Excel header/footer fonts and automation |
Top |
That worked perfect, thanks!
|
| |
|
| |
 |
| |
|