+ Reply to Thread
Results 1 to 5 of 5

Run-time error '1004': Method 'Range' of object '_Global' failed

  1. #1
    Neild
    Guest

    Run-time error '1004': Method 'Range' of object '_Global' failed

    i am developing an excel application to run on a network server which uses
    several userforms.
    the userforms collect data in variables and then write them to cells in
    several worksheets.
    the application works correctly when run on my local workstation but when i
    try to run it from the network, i get this error message.
    i have located an article Q213655 relating to this error which suggests
    using the .Evaluate method in place of the Range.value method however it
    refers to getting a value from a cell and placing it in a variable value.
    i have tried to apply the Evaluate method in the opposite direction (ie
    placing a variable value from the userform into a cell in a worksheet) but i
    get the same '1004' error message.
    does anyone have a solution other then avoiding userforms in the network
    environment?
    --
    Neild

  2. #2
    Tim Williams
    Guest

    Re: Run-time error '1004': Method 'Range' of object '_Global' failed

    Can you show the code which is causing the error?

    Tim

    "Neild" <[email protected]> wrote in message
    news:[email protected]...
    >i am developing an excel application to run on a network server which uses
    > several userforms.
    > the userforms collect data in variables and then write them to cells in
    > several worksheets.
    > the application works correctly when run on my local workstation but when
    > i
    > try to run it from the network, i get this error message.
    > i have located an article Q213655 relating to this error which suggests
    > using the .Evaluate method in place of the Range.value method however it
    > refers to getting a value from a cell and placing it in a variable value.
    > i have tried to apply the Evaluate method in the opposite direction (ie
    > placing a variable value from the userform into a cell in a worksheet) but
    > i
    > get the same '1004' error message.
    > does anyone have a solution other then avoiding userforms in the network
    > environment?
    > --
    > Neild




  3. #3
    Neild
    Guest

    Re: Run-time error '1004': Method 'Range' of object '_Global' fail

    Tim,
    thanks for your reply. here is the code that is generating the error:

    Private Sub SetMarket()
    Worksheets("Sheet1").Range("E7").Value=MarketName
    End Sub

    The value of MarketName is established by the following code:

    Private Sub OptionButton1_Click()
    MarketName = "Canada"
    SetMarket
    End Sub

    MarketName is declared at the beginning of the code for the userform as
    follows:

    Dim MarketName as String

    As i mentioned in my question, this works perfectly when i run the project
    locally. the problem only occurs when i try to run the project on a network
    server and i have already tried the alternative Evaluate procedure but this
    did not resolve the error.

    thanks for any help you can provide.
    --
    Neild


    "Tim Williams" wrote:

    > Can you show the code which is causing the error?
    >
    > Tim
    >
    > "Neild" <[email protected]> wrote in message
    > news:[email protected]...
    > >i am developing an excel application to run on a network server which uses
    > > several userforms.
    > > the userforms collect data in variables and then write them to cells in
    > > several worksheets.
    > > the application works correctly when run on my local workstation but when
    > > i
    > > try to run it from the network, i get this error message.
    > > i have located an article Q213655 relating to this error which suggests
    > > using the .Evaluate method in place of the Range.value method however it
    > > refers to getting a value from a cell and placing it in a variable value.
    > > i have tried to apply the Evaluate method in the opposite direction (ie
    > > placing a variable value from the userform into a cell in a worksheet) but
    > > i
    > > get the same '1004' error message.
    > > does anyone have a solution other then avoiding userforms in the network
    > > environment?
    > > --
    > > Neild

    >
    >
    >


  4. #4
    Tim Williams
    Guest

    Re: Run-time error '1004': Method 'Range' of object '_Global' fail

    Maybe you need to qualify the range reference to include the workbook.

    Tim

    "Neild" <[email protected]> wrote in message
    news:[email protected]...
    > Tim,
    > thanks for your reply. here is the code that is generating the error:
    >
    > Private Sub SetMarket()
    > Worksheets("Sheet1").Range("E7").Value=MarketName
    > End Sub
    >
    > The value of MarketName is established by the following code:
    >
    > Private Sub OptionButton1_Click()
    > MarketName = "Canada"
    > SetMarket
    > End Sub
    >
    > MarketName is declared at the beginning of the code for the userform as
    > follows:
    >
    > Dim MarketName as String
    >
    > As i mentioned in my question, this works perfectly when i run the project
    > locally. the problem only occurs when i try to run the project on a
    > network
    > server and i have already tried the alternative Evaluate procedure but
    > this
    > did not resolve the error.
    >
    > thanks for any help you can provide.
    > --
    > Neild
    >
    >
    > "Tim Williams" wrote:
    >
    >> Can you show the code which is causing the error?
    >>
    >> Tim
    >>
    >> "Neild" <[email protected]> wrote in message
    >> news:[email protected]...
    >> >i am developing an excel application to run on a network server which
    >> >uses
    >> > several userforms.
    >> > the userforms collect data in variables and then write them to cells in
    >> > several worksheets.
    >> > the application works correctly when run on my local workstation but
    >> > when
    >> > i
    >> > try to run it from the network, i get this error message.
    >> > i have located an article Q213655 relating to this error which suggests
    >> > using the .Evaluate method in place of the Range.value method however
    >> > it
    >> > refers to getting a value from a cell and placing it in a variable
    >> > value.
    >> > i have tried to apply the Evaluate method in the opposite direction (ie
    >> > placing a variable value from the userform into a cell in a worksheet)
    >> > but
    >> > i
    >> > get the same '1004' error message.
    >> > does anyone have a solution other then avoiding userforms in the
    >> > network
    >> > environment?
    >> > --
    >> > Neild

    >>
    >>
    >>




  5. #5
    Neild
    Guest

    RE: Run-time error '1004': Method 'Range' of object '_Global' failed

    thanks Tim. you hit it on the nose!
    --
    Neild


    "Neild" wrote:

    > i am developing an excel application to run on a network server which uses
    > several userforms.
    > the userforms collect data in variables and then write them to cells in
    > several worksheets.
    > the application works correctly when run on my local workstation but when i
    > try to run it from the network, i get this error message.
    > i have located an article Q213655 relating to this error which suggests
    > using the .Evaluate method in place of the Range.value method however it
    > refers to getting a value from a cell and placing it in a variable value.
    > i have tried to apply the Evaluate method in the opposite direction (ie
    > placing a variable value from the userform into a cell in a worksheet) but i
    > get the same '1004' error message.
    > does anyone have a solution other then avoiding userforms in the network
    > environment?
    > --
    > Neild


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1