PC Review


Reply
Thread Tools Rate Thread

Autorun macro to fix Tools-Options->view with imported worksheet

 
 
Lyndon Rickards
Guest
Posts: n/a
 
      25th Dec 2005
Greetings,

Have scanned the archive and google so now I come to the Oracles...

Problem:
Multi-worksheet excel file created with perl script. This is a report
with graphics, buttons and hyperlinks probably best done in
html. Don't ask why. Now I need to 'clean up' the appearance by removing
Row&Column headers etc. as available under Tools->Options->View, in each
worksheet.

Proposed:
After the spreadsheet is created, I add a cover page from a template
spreadsheet. I'm thinking it may be possible to copy in a macro
at the same time (from the template) to set the appearance of the
destination workbook. Maybe the macro could even autorun 'run-once' on
the import and delete itself..?

Is this practical? Any pointers, references, examples please?

Bear in mind my native planet is in the galaxy of *nix ;-)

TIA - Lynn.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      25th Dec 2005
Etc is a lot to do (or not).

But this shell may give you an idea of what to do. It displays a file|open
dialog. The user can select as many files as they want and then the template
workbook will be added to each workbook--and just the row/column headings are
hidden.

Option Explicit
Sub testme01()

Dim wksTemplateName As String
Dim myFileNames As Variant
Dim wkbk As Workbook
Dim wks As Worksheet
Dim fCtr As Long
Dim myWindow As Window

wksTemplateName = "C:\my documents\excel\book1.xls"

myFileNames = Application.GetOpenFilename("Excel Files, *.xls", _
MultiSelect:=True)

If IsArray(myFileNames) = False Then
Exit Sub
End If

For fCtr = LBound(myFileNames) To UBound(myFileNames)
Set wkbk = Workbooks.Open(Filename:=myFileNames(fCtr))
Sheets.Add before:=wkbk.Sheets(1), Type:=wksTemplateName
For Each wks In wkbk.Worksheets
wks.Activate
ActiveWindow.DisplayHeadings = False
'anything else you need here
Next wks
Application.Goto wkbk.Worksheets(1).Range("a1"), scroll:=True
wkbk.Save
wkbk.Close savechanges:=False
Next fCtr

End Sub


Lyndon Rickards wrote:
>
> Greetings,
>
> Have scanned the archive and google so now I come to the Oracles...
>
> Problem:
> Multi-worksheet excel file created with perl script. This is a report
> with graphics, buttons and hyperlinks probably best done in
> html. Don't ask why. Now I need to 'clean up' the appearance by removing
> Row&Column headers etc. as available under Tools->Options->View, in each
> worksheet.
>
> Proposed:
> After the spreadsheet is created, I add a cover page from a template
> spreadsheet. I'm thinking it may be possible to copy in a macro
> at the same time (from the template) to set the appearance of the
> destination workbook. Maybe the macro could even autorun 'run-once' on
> the import and delete itself..?
>
> Is this practical? Any pointers, references, examples please?
>
> Bear in mind my native planet is in the galaxy of *nix ;-)
>
> TIA - Lynn.


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      25th Dec 2005
ps...

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Lyndon Rickards wrote:
>
> Greetings,
>
> Have scanned the archive and google so now I come to the Oracles...
>
> Problem:
> Multi-worksheet excel file created with perl script. This is a report
> with graphics, buttons and hyperlinks probably best done in
> html. Don't ask why. Now I need to 'clean up' the appearance by removing
> Row&Column headers etc. as available under Tools->Options->View, in each
> worksheet.
>
> Proposed:
> After the spreadsheet is created, I add a cover page from a template
> spreadsheet. I'm thinking it may be possible to copy in a macro
> at the same time (from the template) to set the appearance of the
> destination workbook. Maybe the macro could even autorun 'run-once' on
> the import and delete itself..?
>
> Is this practical? Any pointers, references, examples please?
>
> Bear in mind my native planet is in the galaxy of *nix ;-)
>
> TIA - Lynn.


--

Dave Peterson
 
Reply With Quote
 
Lyndon Rickards
Guest
Posts: n/a
 
      25th Dec 2005
Thanks Dave - and on Xmas morning, too! Guess this'll be what I'll
be playing with later...

- Lynn.

Dave Peterson wrote:
> Etc is a lot to do (or not).
>
> But this shell may give you an idea of what to do. It displays a file|open
> dialog. The user can select as many files as they want and then the template
> workbook will be added to each workbook--and just the row/column headings are
> hidden.
>
> Option Explicit
> Sub testme01()


<---------snip

>>Bear in mind my native planet is in the galaxy of *nix ;-)
>>
>>TIA - Lynn.

>
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      25th Dec 2005
Good luck...

You may want to record a macro while you're turning things on/off to get the
code to merge into that shell.

Lyndon Rickards wrote:
>
> Thanks Dave - and on Xmas morning, too! Guess this'll be what I'll
> be playing with later...
>
> - Lynn.
>
> Dave Peterson wrote:
> > Etc is a lot to do (or not).
> >
> > But this shell may give you an idea of what to do. It displays a file|open
> > dialog. The user can select as many files as they want and then the template
> > workbook will be added to each workbook--and just the row/column headings are
> > hidden.
> >
> > Option Explicit
> > Sub testme01()

>
> <---------snip
>
> >>Bear in mind my native planet is in the galaxy of *nix ;-)
> >>
> >>TIA - Lynn.

> >
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
tools options view window options Joe Microsoft Excel Misc 1 11th Nov 2009 04:08 PM
Hidden macro: already tried tools>options>view pepenacho Microsoft Access Macros 1 5th Dec 2008 05:10 AM
How set options in Tools--Options--View =?Utf-8?B?bXNjZXJ0aWZpZWQ=?= Microsoft Access Getting Started 2 15th Dec 2005 07:01 PM
How to diasble the 'Tools - Options - View - Comments' options? Alan Microsoft Excel Programming 3 19th May 2005 10:58 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Microsoft Excel Programming 2 25th May 2004 06:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 AM.