![]() |
Run-time error '1004': Method 'Range' of object '_Global' failed
Can you show the code which is causing the error?
Tim "Neild" wrote in message ... 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 |
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" wrote in message ... 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 |
Run-time error '1004': Method 'Range' of object '_Global' fail
Maybe you need to qualify the range reference to include the workbook.
Tim "Neild" wrote in message ... 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" wrote in message ... 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 |
All times are GMT +1. The time now is 08:57 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com