Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a logo to an Excel spread sheet
Message
 
To
10/07/2003 10:40:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00808850
Message ID:
00808856
Views:
20
This message has been marked as the solution to the initial question of the thread.
Addpicture requires more parameters:
expression.AddPicture(FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height)
Add them or try this instead:
objBook.Worksheets(2).Pictures.Insert(CSCLogo)


>Hello All,
>
>I'm trying to add a logo (.gif) to an Excel spreadsheet - from VFP of couse.
>
>The following code throws an error: Variable does not equate to an object.
>
>CSCLogo = "E:\CVS3\Other\LOGO_SIZE1.GIF"
>.Shapes.AddPicture(CSCLogo, .T., .T., )
>
>The above code is taken right out of my "Microsoft Office Automation with VFP" book, page 213. Obviously I've missed something. I'd appreciate it if someone can help me with the syntax here. TIA.
>
>Paige
>
>More complete code follows:
>
>
> oWorkbook = oExcel.Workbooks.open(ExportPath)
> WITH oExcel
> && Insert 3 rows:
> .Cells(1,1).Value=[Insert row above this line]
> .Range("A1").Select
> .Selection.EntireRow.Insert
> .Range("A2").Select
> .Selection.EntireRow.Insert
> .Range("A3").Select
> .Selection.EntireRow.Insert
> .Range("A4").Select
> .Selection.EntireRow.Insert
>
> && Insert 2 line title:
>
> .Range("F1").Value = "INSUFFICIENT DATA REPORT"
> CSCLogo = "E:\CVS3\Other\LOGO_SIZE1.GIF"
> .Shapes.AddPicture(CSCLogo, .T., .T., )
> .Range("F2").Value = " For"
> .Range("F3").Value = lcCli_Name
> && Replace column headings and adjust size:
> .Range("A5").Value = "Client"
>ETC.....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform