View Single Post
 
Old 06-18-2013, 01:08 PM
Ulodesk Ulodesk is offline Windows 7 64bit Office 2010 64bit
Word 2013 Expert Cert
 
Join Date: Sep 2009
Location: Virginia
Posts: 872
Ulodesk is on a distinguished road
Default VBA is objecting (no pun intended)

I copied from Greg Maxey's site a macro for inserting a section and unlinking the headers and footers.
http://gregmaxey.com/word_tip_pages/...k_headers.html
I pasted the macro at the bottom of my list of macros in VBA as I usually do, but VBA objected when I tried to save. As shown below, my last macro ends, then his begin with the four lines shown before his Sub line. There is no horizontal line sepArator until after the last of the four lines, before his Sub line.

End Sub

Option Explicit
Dim i As Long
Dim j As Long
Dim oDoc As Word.Document

Is this what is causing the problem? Is it easy to solve, or do I have to do soemthing with "option explicit" (whatever that is) to all my macros if I want to use this one? I have utterly failed in trying to teach myself VBA several times. I record or paste macros occasionally, as needed. I've never had this problem before.
Reply With Quote