Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
BLeman BLeman is offline
external usenet poster
 
Posts: 3
Default Win 2000 MS Word 2003 macro won't compile, error VB

When trying to compile and run a macro with Word 2003, the VB compiler
returns an erro. The macro code is correct as it will run on other machines.
It appears that the VB library or system is corrupt. How do I fix this?
Macros will compile and run in Excel on the same computer.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Shauna Kelly Shauna Kelly is offline
external usenet poster
 
Posts: 571
Default Win 2000 MS Word 2003 macro won't compile, error VB

Hi BLeman

What error message is displayed? And what is the line of code displayed when
the compiler stops?

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"BLeman" wrote in message
news
When trying to compile and run a macro with Word 2003, the VB compiler
returns an erro. The macro code is correct as it will run on other
machines.
It appears that the VB library or system is corrupt. How do I fix this?
Macros will compile and run in Excel on the same computer.



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
BLeman BLeman is offline
external usenet poster
 
Posts: 3
Default Win 2000 MS Word 2003 macro won't compile, error VB

The Error that is displayed is from Microsoft Visual Basic and is "Compile
Error: Expected: line number or label statement or end of statement". The
actual line it stopped on is the first line: Sub BRL (). The whole macro is
just a test case and is as follows:
Sub BRL()
'
' BRL Macro
' Macro recorded 11/4/2006 by
'
ChangeFileOpenDirectory "C:\RezOvation\"
Documents.Open FileName:="Invoice.rtf", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
ActiveDocument.Close
End Sub

Thanks

BLeman


"Shauna Kelly" wrote:

Hi BLeman

What error message is displayed? And what is the line of code displayed when
the compiler stops?

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"BLeman" wrote in message
news
When trying to compile and run a macro with Word 2003, the VB compiler
returns an erro. The macro code is correct as it will run on other
machines.
It appears that the VB library or system is corrupt. How do I fix this?
Macros will compile and run in Excel on the same computer.




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
BLeman BLeman is offline
external usenet poster
 
Posts: 3
Default Win 2000 MS Word 2003 macro won't compile, error VB

The data that is actually displayed when the compile stops is garbage (misc
characters)

"BLeman" wrote:

The Error that is displayed is from Microsoft Visual Basic and is "Compile
Error: Expected: line number or label statement or end of statement". The
actual line it stopped on is the first line: Sub BRL (). The whole macro is
just a test case and is as follows:
Sub BRL()
'
' BRL Macro
' Macro recorded 11/4/2006 by
'
ChangeFileOpenDirectory "C:\RezOvation\"
Documents.Open FileName:="Invoice.rtf", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
ActiveDocument.Close
End Sub

Thanks

BLeman


"Shauna Kelly" wrote:

Hi BLeman

What error message is displayed? And what is the line of code displayed when
the compiler stops?

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"BLeman" wrote in message
news
When trying to compile and run a macro with Word 2003, the VB compiler
returns an erro. The macro code is correct as it will run on other
machines.
It appears that the VB library or system is corrupt. How do I fix this?
Macros will compile and run in Excel on the same computer.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
Converting WordPerfect 12 files to Word 2003 Curious New Users 4 May 19th 23 02:48 PM
How do I create Word macro that will run properly using copy/past. Joye Microsoft Word Help 1 June 23rd 06 10:41 PM
Word 2003 Mailmerge problem - works in Word 2000 Rick Robinson Mailmerge 2 April 28th 05 10:16 AM
Macros - Keyboard Commands Janet Microsoft Word Help 6 April 11th 05 05:28 AM


All times are GMT +1. The time now is 08:28 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"