Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 655287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:35:14+00:00 2026-05-13T22:35:14+00:00

I have been going mad trying to figure out why my scripts weren’t working,

  • 0

I have been going mad trying to figure out why my scripts weren’t working, until I started copying and pasting sample source code directly from a few websites only to have it fail there as well. I am getting the following error in my VBScripts:

C:\temp\vbs\script.vbs(19, 53) Microsoft VBScript compilation error: Expected statement’

For a line of code that looks like this:

    wdoc.Application.Selection.Find.Execute Replace:=wdReplaceAll

This is interfacing with Microsft Word in Office 2007 to conduct a search and replace. Index 53 point directly to the := part of the assignment. Since this type of syntax doesn’t work on my machine and I am using it from several websites, I was wondering if the cscript.exe I use is out of date.

Am I not calling cscript properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:35:14+00:00Added an answer on May 13, 2026 at 10:35 pm

    Named arguments (Param:=Value) are Visual Basic and VBA feature; this syntax isn’t supported in VBScript.

    In VBScript, you need to preserve the actual order of a routine’s arguments. If a specific argument is optional and you want to use its default value, you need to simply omit that argument. So, your code should look like this:

    Const wdReplaceAll = 2
    wdoc.Application.Selection.Find.Execute , , , , , , , , , , wdReplaceAll
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive been trying to sort out output using AWK, and have been pretty successful
Lately I have been working on OS X. Things were going pretty peachy for
I have been going through the book Learning WCF trying to get my head
I have been going back through my app trying to handle all the memory
Just started using carrierwave with Rails and things have been going smoothly with one
I have been working in some C language function that is going to be
I have been going back and forth between C# and Java for the last
I've switched over to a Mac recently and, although things have been going quite
I have been tasked with going through a number of ColdFusion sites that have
I have been using C# for a while now, and going back to C++

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.