+ Reply to Thread
Results 1 to 6 of 6

Deleting VBA programs

  1. #1
    Registered User
    Join Date
    11-13-2005
    Location
    Moscow
    Posts
    41

    Smile Deleting VBA programs

    HELLO
    I am hoping that someone can help me with this problem. Well it all started when I copied and pasted a small VBA program from the internet. The VBA program was to stop anyone from copying or cutting and pasting any of my work. However this VBA program went to all excel sheets and now I cannot cut or copy by using the the left mouse or the cut/copy in edit. I can however still cut and copy by using control+c/x. I have so far deleted the VBA program plus I have deleted the excel program itself and I have even deleted Microsoft Office and then reloaded it. And still I have the same problem. I have also gone into VBA and I cannot find any trace of the VBA program that I installed in the first place. Plus I have checked all options in the tool bar. If I cannot solve this in the end I will have to reload windows all together. Thanks in advance if you can help me correct this problem.

    Paul

  2. #2
    Norman Jones
    Guest

    Re: Deleting VBA programs

    Hi Paul,

    Try:

    '=============>>
    Sub Test()
    Dim Ctl As CommandBarControl
    Dim CBar As Long

    On Error Resume Next
    For CBar = 1 To Application.CommandBars.Count
    For Each Ctl In Application.CommandBars(CBar).Controls
    With Application.CommandBars(CBar)
    .FindControl(ID:=19, Recursive:=True).Enabled = True
    .FindControl(ID:=21, Recursive:=True).Enabled = True
    .FindControl(ID:=22, Recursive:=True).Enabled = True
    Next Ctl
    Next CBar
    On Error GoTo 0
    End Sub
    '<<=============

    ---
    Regards,
    Norman


    "paulrm906" <[email protected]> wrote
    in message news:[email protected]...
    >
    > HELLO
    > I am hoping that someone can help me with this problem. Well it all
    > started when I copied and pasted a small VBA program from the internet.
    > The VBA program was to stop anyone from copying or cutting and pasting
    > any of my work. However this VBA program went to all excel sheets and
    > now I cannot cut or copy by using the the left mouse or the cut/copy in
    > edit. I can however still cut and copy by using control+c/x. I have so
    > far deleted the VBA program plus I have deleted the excel program
    > itself and I have even deleted Microsoft Office and then reloaded it.
    > And still I have the same problem. I have also gone into VBA and I
    > cannot find any trace of the VBA program that I installed in the first
    > place. Plus I have checked all options in the tool bar. If I cannot
    > solve this in the end I will have to reload windows all together.
    > Thanks in advance if you can help me correct this problem.
    >
    > Paul
    >
    >
    > --
    > paulrm906
    > ------------------------------------------------------------------------
    > paulrm906's Profile:
    > http://www.excelforum.com/member.php...o&userid=28776
    > View this thread: http://www.excelforum.com/showthread...hreadid=494064
    >




  3. #3
    Dave Peterson
    Guest

    Re: Deleting VBA programs

    You have more replies at your other post.

    paulrm906 wrote:
    >
    > HELLO
    > I am hoping that someone can help me with this problem. Well it all
    > started when I copied and pasted a small VBA program from the internet.
    > The VBA program was to stop anyone from copying or cutting and pasting
    > any of my work. However this VBA program went to all excel sheets and
    > now I cannot cut or copy by using the the left mouse or the cut/copy in
    > edit. I can however still cut and copy by using control+c/x. I have so
    > far deleted the VBA program plus I have deleted the excel program
    > itself and I have even deleted Microsoft Office and then reloaded it.
    > And still I have the same problem. I have also gone into VBA and I
    > cannot find any trace of the VBA program that I installed in the first
    > place. Plus I have checked all options in the tool bar. If I cannot
    > solve this in the end I will have to reload windows all together.
    > Thanks in advance if you can help me correct this problem.
    >
    > Paul
    >
    > --
    > paulrm906
    > ------------------------------------------------------------------------
    > paulrm906's Profile: http://www.excelforum.com/member.php...o&userid=28776
    > View this thread: http://www.excelforum.com/showthread...hreadid=494064


    --

    Dave Peterson

  4. #4
    Registered User
    Join Date
    11-13-2005
    Location
    Moscow
    Posts
    41

    Deleting VBA

    Hello Norman

    Thanks for your help but sorry to have to inform you it did not help me.

    Thanks Again

    PaUL Maynard

    Quote Originally Posted by Norman Jones
    Hi Paul,

    Try:

    '=============>>
    Sub Test()
    Dim Ctl As CommandBarControl
    Dim CBar As Long

    On Error Resume Next
    For CBar = 1 To Application.CommandBars.Count
    For Each Ctl In Application.CommandBars(CBar).Controls
    With Application.CommandBars(CBar)
    .FindControl(ID:=19, Recursive:=True).Enabled = True
    .FindControl(ID:=21, Recursive:=True).Enabled = True
    .FindControl(ID:=22, Recursive:=True).Enabled = True
    Next Ctl
    Next CBar
    On Error GoTo 0
    End Sub
    '<<=============

    ---
    Regards,
    Norman


    "paulrm906" <[email protected]> wrote
    in message news:[email protected]...
    >
    > HELLO
    > I am hoping that someone can help me with this problem. Well it all
    > started when I copied and pasted a small VBA program from the internet.
    > The VBA program was to stop anyone from copying or cutting and pasting
    > any of my work. However this VBA program went to all excel sheets and
    > now I cannot cut or copy by using the the left mouse or the cut/copy in
    > edit. I can however still cut and copy by using control+c/x. I have so
    > far deleted the VBA program plus I have deleted the excel program
    > itself and I have even deleted Microsoft Office and then reloaded it.
    > And still I have the same problem. I have also gone into VBA and I
    > cannot find any trace of the VBA program that I installed in the first
    > place. Plus I have checked all options in the tool bar. If I cannot
    > solve this in the end I will have to reload windows all together.
    > Thanks in advance if you can help me correct this problem.
    >
    > Paul
    >
    >
    > --
    > paulrm906
    > ------------------------------------------------------------------------
    > paulrm906's Profile:
    > http://www.excelforum.com/member.php...o&userid=28776
    > View this thread: http://www.excelforum.com/showthread...hreadid=494064
    >

  5. #5
    Peter T
    Guest

    Re: Deleting VBA programs

    Hi Paul,

    First thing - Re-installing Excel, Office or even Windows won't solve your
    problem
    Second thing - don't panic!

    Looks like something went astray when Norman's pasted his code, try

    Sub Test2()
    Dim Ctl As CommandBarControl
    Dim CBar As Long

    On Error Resume Next
    For CBar = 1 To Application.CommandBars.Count
    With Application.CommandBars(CBar)
    For Each Ctl In .Controls
    .FindControl(ID:=19, Recursive:=True).Enabled = True
    .FindControl(ID:=21, Recursive:=True).Enabled = True
    .FindControl(ID:=22, Recursive:=True).Enabled = True
    Next Ctl
    End With
    Next CBar
    On Error GoTo 0
    End Sub

    However I imagine you would already have picked this up as the code could
    not have run.

    If your original code actually deleted the controls even this might not
    work.

    Close Excel and search your folders for your Excel toolbars file. Exact name
    and location is version dependant so search its extension *.xlb

    Rename the extension .old

    Re-start Excel and it will create new default set of toolbars and create a
    new *.xlb file (when you next close Excel). You will loose previously
    customised toolbars. If that's a pain post the code that caused all your
    problems, maybe it can be reversed over your original customised toolbars.

    Regards,
    Peter T

    "paulrm906" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hello Norman
    >
    > Thanks for your help but sorry to have to inform you it did not help
    > me.
    >
    > Thanks Again
    >
    > PaUL Maynard
    >
    > Norman Jones Wrote:
    > > Hi Paul,
    > >
    > > Try:
    > >
    > > '=============>>
    > > Sub Test()
    > > Dim Ctl As CommandBarControl
    > > Dim CBar As Long
    > >
    > > On Error Resume Next
    > > For CBar = 1 To Application.CommandBars.Count
    > > For Each Ctl In Application.CommandBars(CBar).Controls
    > > With Application.CommandBars(CBar)
    > > .FindControl(ID:=19, Recursive:=True).Enabled = True
    > > .FindControl(ID:=21, Recursive:=True).Enabled = True
    > > .FindControl(ID:=22, Recursive:=True).Enabled = True
    > > Next Ctl
    > > Next CBar
    > > On Error GoTo 0
    > > End Sub
    > > '<<=============
    > >
    > > ---
    > > Regards,
    > > Norman
    > >
    > >
    > > "paulrm906" <[email protected]>
    > > wrote
    > > in message
    > > news:[email protected]...
    > > >
    > > > HELLO
    > > > I am hoping that someone can help me with this problem. Well it all
    > > > started when I copied and pasted a small VBA program from the

    > > internet.
    > > > The VBA program was to stop anyone from copying or cutting and

    > > pasting
    > > > any of my work. However this VBA program went to all excel sheets

    > > and
    > > > now I cannot cut or copy by using the the left mouse or the cut/copy

    > > in
    > > > edit. I can however still cut and copy by using control+c/x. I have

    > > so
    > > > far deleted the VBA program plus I have deleted the excel program
    > > > itself and I have even deleted Microsoft Office and then reloaded

    > > it.
    > > > And still I have the same problem. I have also gone into VBA and I
    > > > cannot find any trace of the VBA program that I installed in the

    > > first
    > > > place. Plus I have checked all options in the tool bar. If I cannot
    > > > solve this in the end I will have to reload windows all together.
    > > > Thanks in advance if you can help me correct this problem.
    > > >
    > > > Paul
    > > >
    > > >
    > > > --
    > > > paulrm906
    > > >

    > > ------------------------------------------------------------------------
    > > > paulrm906's Profile:
    > > > http://www.excelforum.com/member.php...o&userid=28776
    > > > View this thread:

    > > http://www.excelforum.com/showthread...hreadid=494064
    > > >

    >
    >
    > --
    > paulrm906
    > ------------------------------------------------------------------------
    > paulrm906's Profile:

    http://www.excelforum.com/member.php...o&userid=28776
    > View this thread: http://www.excelforum.com/showthread...hreadid=494064
    >




  6. #6
    Norman Jones
    Guest

    Re: Deleting VBA programs

    Hi Peter,

    > Looks like something went astray when Norman's pasted his code


    Thank you for the catch. That was very sloppy!


    ---
    Regards,
    Norman



    "Peter T" <peter_t@discussions> wrote in message
    news:%[email protected]...
    > Hi Paul,
    >
    > First thing - Re-installing Excel, Office or even Windows won't solve your
    > problem
    > Second thing - don't panic!
    >
    > Looks like something went astray when Norman's pasted his code, try
    >
    > Sub Test2()
    > Dim Ctl As CommandBarControl
    > Dim CBar As Long
    >
    > On Error Resume Next
    > For CBar = 1 To Application.CommandBars.Count
    > With Application.CommandBars(CBar)
    > For Each Ctl In .Controls
    > .FindControl(ID:=19, Recursive:=True).Enabled = True
    > .FindControl(ID:=21, Recursive:=True).Enabled = True
    > .FindControl(ID:=22, Recursive:=True).Enabled = True
    > Next Ctl
    > End With
    > Next CBar
    > On Error GoTo 0
    > End Sub
    >
    > However I imagine you would already have picked this up as the code could
    > not have run.
    >
    > If your original code actually deleted the controls even this might not
    > work.
    >
    > Close Excel and search your folders for your Excel toolbars file. Exact
    > name
    > and location is version dependant so search its extension *.xlb
    >
    > Rename the extension .old
    >
    > Re-start Excel and it will create new default set of toolbars and create a
    > new *.xlb file (when you next close Excel). You will loose previously
    > customised toolbars. If that's a pain post the code that caused all your
    > problems, maybe it can be reversed over your original customised toolbars.
    >
    > Regards,
    > Peter T
    >
    > "paulrm906" <[email protected]> wrote
    > in message news:[email protected]...
    >>
    >> Hello Norman
    >>
    >> Thanks for your help but sorry to have to inform you it did not help
    >> me.
    >>
    >> Thanks Again
    >>
    >> PaUL Maynard
    >>
    >> Norman Jones Wrote:
    >> > Hi Paul,
    >> >
    >> > Try:
    >> >
    >> > '=============>>
    >> > Sub Test()
    >> > Dim Ctl As CommandBarControl
    >> > Dim CBar As Long
    >> >
    >> > On Error Resume Next
    >> > For CBar = 1 To Application.CommandBars.Count
    >> > For Each Ctl In Application.CommandBars(CBar).Controls
    >> > With Application.CommandBars(CBar)
    >> > .FindControl(ID:=19, Recursive:=True).Enabled = True
    >> > .FindControl(ID:=21, Recursive:=True).Enabled = True
    >> > .FindControl(ID:=22, Recursive:=True).Enabled = True
    >> > Next Ctl
    >> > Next CBar
    >> > On Error GoTo 0
    >> > End Sub
    >> > '<<=============
    >> >
    >> > ---
    >> > Regards,
    >> > Norman
    >> >
    >> >
    >> > "paulrm906" <[email protected]>
    >> > wrote
    >> > in message
    >> > news:[email protected]...
    >> > >
    >> > > HELLO
    >> > > I am hoping that someone can help me with this problem. Well it all
    >> > > started when I copied and pasted a small VBA program from the
    >> > internet.
    >> > > The VBA program was to stop anyone from copying or cutting and
    >> > pasting
    >> > > any of my work. However this VBA program went to all excel sheets
    >> > and
    >> > > now I cannot cut or copy by using the the left mouse or the cut/copy
    >> > in
    >> > > edit. I can however still cut and copy by using control+c/x. I have
    >> > so
    >> > > far deleted the VBA program plus I have deleted the excel program
    >> > > itself and I have even deleted Microsoft Office and then reloaded
    >> > it.
    >> > > And still I have the same problem. I have also gone into VBA and I
    >> > > cannot find any trace of the VBA program that I installed in the
    >> > first
    >> > > place. Plus I have checked all options in the tool bar. If I cannot
    >> > > solve this in the end I will have to reload windows all together.
    >> > > Thanks in advance if you can help me correct this problem.
    >> > >
    >> > > Paul
    >> > >
    >> > >
    >> > > --
    >> > > paulrm906
    >> > >
    >> > ------------------------------------------------------------------------
    >> > > paulrm906's Profile:
    >> > > http://www.excelforum.com/member.php...o&userid=28776
    >> > > View this thread:
    >> > http://www.excelforum.com/showthread...hreadid=494064
    >> > >

    >>
    >>
    >> --
    >> paulrm906
    >> ------------------------------------------------------------------------
    >> paulrm906's Profile:

    > http://www.excelforum.com/member.php...o&userid=28776
    >> View this thread:
    >> http://www.excelforum.com/showthread...hreadid=494064
    >>

    >
    >




+ 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