Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Please help with AddItem method

Hi
I have posted this query before but got no response that would solve my proble
I have a code as below which when I run gives "Run-Time Error 70: Permission Denied" while it is working fine with other comboxes
read3 =
While Worksheets("QUERY_BUILDER").Range("AR" + CStr(read3)).Value < Empt
Worksheets("QUERY_BUILDER").ComboBox6.AddItem CStr(Worksheets("QUERY_BUILDER").Range("AR" + CStr(read3)).Value
read3 = read3 +
Wen
Whenever I run this code it gives "Run-Time error" Permission Denied
This code is working for other comboboxes
Please tell me why is this behaving this way and what should I do
TIH
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Please help with AddItem method

If you didn't get the answer you wanted the I assume you
know the answer. On the other hand, perhaps re-phrase the
question. This news group has a lot of people that try
very harde to provide solutions.
The following code works fine - I tidied your up and was
not able to reproduce your problem

Sub LoadCB6()
Dim read3 As Long
read3 = 2
With Worksheets("QUERY_BUILDER")
.ComboBox6.Clear
Do While .Cells(read3, "AR") < ""
.ComboBox6.AddItem .Cells(read3, "AR").Value
read3 = read3 + 1
Loop
End With

End Sub


-----Original Message-----
Hi,
I have posted this query before but got no response that

would solve my problem
I have a code as below which when I run gives "Run-Time

Error 70: Permission Denied" while it is working fine
with other comboxes.
read3 = 2
While Worksheets("QUERY_BUILDER").Range("AR" + CStr

(read3)).Value < Empty
Worksheets("QUERY_BUILDER").ComboBox6.AddItem CStr

(Worksheets("QUERY_BUILDER").Range("AR" + CStr
(read3)).Value)
read3 = read3 + 1
Wend
Whenever I run this code it gives "Run-Time error"

Permission Denied.
This code is working for other comboboxes.
Please tell me why is this behaving this way and what

should I do?
TIH
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Please help with AddItem method

Here is the help for error 70

Permission denied (Error 70)
Specifics

An attempt was made to write to a write-protected disk or to access a locked
file. This error has the following causes and solutions:

a.. You tried to open a write-protected file for sequential Output or
Append.
Open the file for Input or change the write-protection attribute of the
file.

b.. You tried to open a file on a disk that is write-protected for
sequential Output or Append.
Remove the write-protection device from the disk or open the file for
Input.

c.. You tried to write to a file that another process locked.
Wait to open the file until the other process releases it.

d.. You attempted to access the registry, but your user permissions don't
include this type of registry access.
On 32-bit Microsoft Windows systems, a user must have the correct
permissions for access to the system registry. Change your permissions or
have them changed by the system administrator.

For additional information, select the item in question and press F1.



I suspect that some file or registry entry associated with your control is
screwed up. I would delete the control. Then I would close excel and clean
out the temp directory including removing any subdirectories in the temp
directory that include excel or vba in the name.



Then re-open excel and add a combobox and name it to ComboboBox6.



Then see if you get the error.



--

Regards,

Tom Ogilvy



"Shilps" wrote in message
...
Hi,
I have posted this query before but got no response that would solve my

problem
I have a code as below which when I run gives "Run-Time Error 70:

Permission Denied" while it is working fine with other comboxes.
read3 = 2
While Worksheets("QUERY_BUILDER").Range("AR" + CStr(read3)).Value < Empty
Worksheets("QUERY_BUILDER").ComboBox6.AddItem

CStr(Worksheets("QUERY_BUILDER").Range("AR" + CStr(read3)).Value)
read3 = read3 + 1
Wend
Whenever I run this code it gives "Run-Time error" Permission Denied.
This code is working for other comboboxes.
Please tell me why is this behaving this way and what should I do?
TIH



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please post this thread a correct full method, method about Nast Runsome New Users to Excel 8 February 25th 08 03:29 PM
Please post this thread a complete correct method, method about te Nast Runsome New Users to Excel 0 February 23rd 08 09:42 PM
Help with: ListBox1.AddItem (ws.Name) Ron de Bruin Excel Worksheet Functions 0 May 18th 05 07:02 PM
.additem Robert Couchman[_4_] Excel Programming 3 February 20th 04 02:47 PM
additem listbox CG Rosén Excel Programming 2 December 14th 03 08:58 PM


All times are GMT +1. The time now is 09:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"