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 8142745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:54:27+00:00 2026-06-06T12:54:27+00:00

The following code tries to attach to an excel session that has the C:\test

  • 0

The following code tries to attach to an excel session that has the C:\test file opened. If such a session doesn’t exist, this either returns null or throws an exception.

 var myExcelWorkbook = Marshal.BindToMoniker(@"C:\test") as Excel.Workbook;

This works very well when the file has no extension. However if I am trying the exact same code with a file that has an extension (for instance C:\test.xlsb), the call tries to open that file with excel before returning. If an instance is already running, it will try to open the file in that instance (as if someone double-clicked on that file in the windows explorer).

 var myExcelWorkbook = Marshal.BindToMoniker(@"C:\test.xlsb") as Excel.Workbook;

This definitely has to do with the extension (how would BindToMoniker know how to open Excel otherwise?), but is very annoying, since I never want to attach to an existing excel session that doesn’t have that file already opened.

Is there a way to disable that “feature”? I would like that the BindToMoniker method never tries to open a file and let me decide what to do in the various cases.

  • 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-06-06T12:54:28+00:00Added an answer on June 6, 2026 at 12:54 pm

    The issue is most likely with how Excel documents are named in “running objects table” rather than presence of extension.

    Read on IRunningObjectTable… There is IRunningObjectTable.EnumRunning which may be useful.

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

Sidebar

Related Questions

The following simple code tries to post a wave file to Google Speech2Text service,
I have the following code that tries to tie arrays to files. Except, when
I have a MediaPlayerActivity with the following code: This code basically tries to get
The following code utilizes CreateProcess to run commands with environmental variables. Here, it tries
I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport(UxTheme.DLL, BestFitMapping:=False,
I tried using the following code for a HTML page, but it doesn't work.
I tried the following code tree. If I put the header file hello.h into
I tried the following code: import java.math.BigInteger; import org.apache.commons.codec.binary.Base32; import org.junit.Test; public class Sandbox
I have the following code that creates a draggable and droppable element/area. And when
Following this guide: http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide I was not able to configure a Hello World WSGI

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.