Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Can you use a macro to insert a graphic? Or apply a template?

We get a data export as a .csv that automatically opens Excel. I've
written/recorded a macro that sets column width, adds header rows and a
footer, changes fonts, and whatnot.

One thing I cannot make it do is insert a graphic of our logo. Any ideas?

In addition to having the graphic as a separate, importable file, I have it
in a template. The problem is that is seems the template only works for new
spreadsheets. It doesn't seem that you can apply it to an open worksheet the
way you can with a style in Word.

Is this graphic thing workable at all?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Can you use a macro to insert a graphic? Or apply a template?

You should be able to use something like the following:

ActiveSheet.Pictures.Insert( _
"C:\Documents and Settings\Documents\My Pictures\Sample
Pictures\Sunset.jpg" _
).Select

Just change the file location to match your logo. You can then record a
macro of you adjusting size, if necessary.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"TychaBrahe" wrote:

We get a data export as a .csv that automatically opens Excel. I've
written/recorded a macro that sets column width, adds header rows and a
footer, changes fonts, and whatnot.

One thing I cannot make it do is insert a graphic of our logo. Any ideas?

In addition to having the graphic as a separate, importable file, I have it
in a template. The problem is that is seems the template only works for new
spreadsheets. It doesn't seem that you can apply it to an open worksheet the
way you can with a style in Word.

Is this graphic thing workable at all?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Can you use a macro to insert a graphic? Or apply a template?

How are you importing the .csv data?

If you're using file|open, you could open the .csv file and then do all the
formatting, then create a new workbook based on your template, then copy the
..csv data into that workbook (first sheet???) and close the .csv file without
saving.

With no testing at all:

Dim CSVWks as worksheet
dim RptWks as worksheet

set csvwks = Workbooks.Open(Filename:="yourcsvfilename.csv").wo rksheets(1)

set rptwks _
= workbooks.add(Template:="C:\yourpath\myfile.xlt"). worksheets("sheet1")

'do the formatting work in csvwks if you want.
'or wait to do it in the template worksheet

csvwks.cells.copy _
destination:=rptwks.range("A1")

csvwks.parent.close savechanges:=false

============
If you're importing your csv data via Data|Import External Data, you should be
able to open the template file and import it directly onto the sheet you want.

TychaBrahe wrote:

We get a data export as a .csv that automatically opens Excel. I've
written/recorded a macro that sets column width, adds header rows and a
footer, changes fonts, and whatnot.

One thing I cannot make it do is insert a graphic of our logo. Any ideas?

In addition to having the graphic as a separate, importable file, I have it
in a template. The problem is that is seems the template only works for new
spreadsheets. It doesn't seem that you can apply it to an open worksheet the
way you can with a style in Word.

Is this graphic thing workable at all?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I insert a graphic into header of spreadsheet Al Nichols Excel Discussion (Misc queries) 1 December 1st 06 01:35 AM
How do I insert a graphic into header of spreadsheet JMay Excel Discussion (Misc queries) 0 November 29th 06 08:34 PM
Algebra graphic template sarasmiles Excel Discussion (Misc queries) 1 November 4th 06 04:39 PM
Macro or OLE method to insert worksheet from template workbook Lyndon Rickards Excel Discussion (Misc queries) 0 January 30th 06 08:46 PM
Insert a graphic in a cell Pete_Escher fan Excel Discussion (Misc queries) 1 February 10th 05 06:04 PM


All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"