Results 1 to 2 of 2

Thread: Update Excel links/content from vb.net/c#

  1. #1

    Thread Starter
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577

    Update Excel links/content from vb.net/c#

    Hi Forum,

    In Excel 2007, when you open up a file that has links to externel files, or you have an ODBC to a database, excel displays a bar near the top of the screen for the user to enable the content manually.

    I have written an application that scans a folder for excel files, opens each one up, makes a small change, save then close the file.

    This is working great however, some of the files use externel links and/or ODBC data connections.

    What I would like my application to do now is, open up the excel file. Enable the content, then save the file after.

    I am currently using
    Code:
    xlWorkbook.ForceFullCalculation = true;
    directly after I open the file, but this doesn't seem to do what I want.

    Thanks for the help

  2. #2

    Thread Starter
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577

    Re: Update Excel links/content from vb.net/c#

    After a bit of of digging I have also come up with
    Code:
            for (int con = 1; con <= xlWorkbook.Connections.Count; con++)
                {
                    xlWorkbook.Connections[con].Refresh();
                }
    Sadly, that doesn't seem to work for me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width