Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6233511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:18:50+00:00 2026-05-24T10:18:50+00:00

I am trying to programattically edit a checked in file, then check it out

  • 0

I am trying to programattically edit a checked in file, then check it out and save the changes made while it was check in. And then check it back in with the saved changes:
Edit -> CheckOut -> Save -> CheckIn

When attempting to save, I am running into a problem that the file does not recognize itself in the folder and thinks its attempting to overwrite another file.

    void checkOut(string sourcefile)
    {
        ClearCase.CCElement element = m_CC.get_Element(sourcefile);

        if (element != null)
        {
            ClearCase.CCVersion latestVersion = null;
            FileInfo fi = new FileInfo(sourcefile);

            latestVersion = element.get_Version();
            if (latestVersion != null)
            {
                ClearCase.CCBranch branch = latestVersion.Branch;
                ClearCase.CCCheckedOutFile file = latestVersion.CheckOut(ClearCase.CCReservedState.ccReserved, "", false, ClearCase.CCVersionToCheckOut.ccVersion_SpecificVersion, true, false);
                string path = file.ExtendedPath;
            }
        }
    }

    void checkIn(string sourcefile)
    {
        ClearCase.CCElement element = m_CC.get_Element(sourcefile);
        element.CheckedOutFile.CheckIn("", true, sourcefile, ClearCase.CCKeepState.ccRemove);
    }


    void excelEdit()
    {
      string fileName = Globals.ThisAddIn.Application.ActiveWorkbook.Name;

      //EDIT EXCEL FILE from (fileName)

      checkOut(fileName);
      Globals.ThisAddIn.Application.ActiveWorkbook.SaveAs(fileName);
      checkIn(fileName);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:18:51+00:00Added an answer on May 24, 2026 at 10:18 am

    That’s not the process you would use if you were doing it manually and not the way I’d recommend to do it programmatically.

    You should CHECK OUT the file first (which will make it writeable on disk), EDIT it, SAVE it, then CHECK it back IN (which will make it read-only on disk).

    You may think that in Visual Studio you start editing before you check out, but in reality, Visual Studio will check the file out when you start to edit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find out programatically the max permgen and max heap size
I am trying to edit a control which doesn't have an .ascx page, it
Read EDIT 2 first I am trying to set up some way to visually
Ok, I am trying to use Tail to monitor a log file, but I
I am trying to programatically generate movie/video file using Google Earth COM APIs (along
I'm trying to print a pcl file programatically in c#. I'm using the following
I'm trying to figure out a way of localizing the application icon (Icon.png) for
Is it possible to edit a path programmatically? I'm trying to create a userControl
I'm trying to programmatically replace <? with <?php in a bunch of file, but
I am trying to provide my own labelFunction for a CategoryAxis programatically but am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.