+ Reply to Thread
Results 1 to 5 of 5

I don't want to run visual basic editer code after saving...

  1. #1
    Registered User
    Join Date
    10-19-2005
    Posts
    38

    Question I don't want to run visual basic editer code after saving...

    Hi All,

    Iam writing some code to disable some controls in excel visual basic editor under Workbook_Open() function for one particular excel template.
    It is working fine.all controls are disabled when i open the excel.
    now i used "save as" option and saved in some folder.

    Now the problem is coming. I want to open the saved file i don't want to run the Workbook_Open() code because i don't want to disable the controls for saved excel file.

    Regards,
    Amar...

  2. #2
    Forum Contributor
    Join Date
    03-24-2004
    Location
    Edam Netherlands
    Posts
    181
    Your can remove code from a workbook from vba code.

    Put the code in :

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)



    End Sub

  3. #3
    Bob Phillips
    Guest

    Re: I don't want to run visual basic editer code after saving...

    Can't you just remove the code from that file?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "areddy" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi All,
    >
    > Iam writing some code to disable some controls in excel visual basic
    > editor under Workbook_Open() function for one particular excel
    > template.
    > It is working fine.all controls are disabled when i open the excel.
    > now i used "save as" option and saved in some folder.
    >
    > Now the problem is coming. I want to open the saved file i don't want
    > to run the Workbook_Open() code because i don't want to disable the
    > controls for saved excel file.
    >
    > Regards,
    > Amar...
    >
    >
    > --
    > areddy
    > ------------------------------------------------------------------------
    > areddy's Profile:

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




  4. #4
    Tom Ogilvy
    Guest

    Re: I don't want to run visual basic editer code after saving...

    Private Sub Workbook_Open()
    if thisworkbook.Path <> "" then exit sub
    ' current code
    End sub


    --
    Regards,
    Tom Ogilvy


    "areddy" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi All,
    >
    > Iam writing some code to disable some controls in excel visual basic
    > editor under Workbook_Open() function for one particular excel
    > template.
    > It is working fine.all controls are disabled when i open the excel.
    > now i used "save as" option and saved in some folder.
    >
    > Now the problem is coming. I want to open the saved file i don't want
    > to run the Workbook_Open() code because i don't want to disable the
    > controls for saved excel file.
    >
    > Regards,
    > Amar...
    >
    >
    > --
    > areddy
    > ------------------------------------------------------------------------
    > areddy's Profile:

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




  5. #5
    Registered User
    Join Date
    10-19-2005
    Posts
    38

    Thanks Tom Ogilvy

    Thanks to all of them.

    and thanks Tom Ogilvy..

    i will try that option..

    Regards,
    Amar...

+ 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