LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Check my code to use template?

I have created a template to use every two or three days. It's coded on a
Workbook_Open event as ReadOnly, with the data-bearing sheets set to
xlVeryHidden. If I'm going to use this as a template, I need to be able to
open it from within a macro with all macros disabled and all sheets visible.



At the moment, the macro that creates my spreadsheet calls up a new workbook
using

Set wb3 = Workbooks.Add
so I need to replace that with code to call up this template. Do I have the
right code to -



call up from a macro?

Dim wb3 As Workbook

wb3 = C:\Documents and Settings\ etc. \filename.xls



disable macros?

Application.EnableEvents = False



make sheets visible?

wb3.Sheets(Sheet1).Visible = True

wb3.Sheets(Sheet2).Visible = True

wb3.Sheets(Sheet3).Visible = True



Two further questions about the EnableEvents -



(1) will it affect the macro already running, or any other macros called up
in the process? do I have to constrain the command somehow to affect only
the workbook I'm opening?



(2) where is the best place to put the Application.EnableEvents = True?
just before I SaveAs? or after?



Thank you.



Ed


 
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
Check Box - Macro code Vicky Excel Discussion (Misc queries) 2 March 17th 09 08:28 AM
code to check condition for each row Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 February 10th 09 08:07 PM
Please check my code!!!! Tdp Excel Discussion (Misc queries) 1 October 27th 08 02:39 PM
Bank Check Template sonicj Excel Discussion (Misc queries) 0 February 6th 06 11:31 PM
template for check requests suave Excel Worksheet Functions 1 June 27th 05 06:36 PM


All times are GMT +1. The time now is 05:47 PM.

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

About Us

"It's about Microsoft Excel"