Interacting with current/open Excel documents

Is there any sort of magic that needs to be done to interact with currently open Excel documents in any meaningful state? If I try to open an already open Excel document with the standard method:
$Excel = New-Object -Com Excel.Application
$Workbook = $Excel.Workbooks.Open($ExcelFilePath)
$Worksheet = $Workbook.Worksheets.Item(1)
$Worksheet.name = 'testing'
$Workbook.save()
$Workbook.close()
It either does nothing or gives an error message saying the file is already open for editing. Makes sense. I've also tried getting the active Excel object (as referenced somewhere else on TechNet forums that I can't bother tracking down atm), like this:
$Excel = [Runtime.Interopservices.Marshal]::GetActiveObject('Excel.Application')
$Workbook = $Excel.Workbooks.Open($FilePath)
... the rest is the same.
No difference. If I close the document without saving and re-open it, the changes will manifest though, so that's something. Is there something I'm doing wrong? Is there another way to do this? Is this impossible? Thanks for any help you can provide.

Hi Bmwinstead,
I ran the script on win 8.1 with Office 2013 without issue, and renamed the worksheet:
Would you please post your test enviroment?
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Similar Messages

  • How to list all currently open Excel files with ActiveX?

    Hello all!
    I would like to program with ActiveX a way to retrieve a list (array of strings) of the filenames of the currently opened Excel files in windows. However, I am fairly new to the ActiveX/Excel business in LV and after hours looking at the "millions" of objects in the property nodes I give up and hope some kind soul here can help me. I couldn't find any information in this forum regarding the same issue, although some were close
    I am using LV 7.1 without the Report Generation Toolkit.
    Thanks!
    /Goran

    Hi KC,
    thanks for your reply. I have in fact been able to find the desired things in the ActiveX properties/methods for Excel in LabView. It took me some looong work going through the functions which I suspected to be the ones. Anyway, I post a little jpeg here of the code if someone ever needs the same functionality. What it does is that it checks how many Excel workbooks are open and controls if each of them matches the searched Excel filename, if one does, it is closed.
    Enjoy
    /Goran
    Attachments:
    List open excel sheets and close open ones.jpg ‏104 KB

  • Getting error while opening Excel document from SharePoint site

    Hello All,
    I am getting following error while opening Excel document from SharePoint site.
    This issue appears when we open Excel document from Windows>> Run using below mentioned command:
    Excel.exe "{File Name}"
    If once I go to Excel back stage and browse for the SharePoint location, then this problem disappears.
    I have a work around for this issue but main problem is that i do not have any work around when i need to open Exel document using Excel COM interop in C#.
    Thanks,
    Amit Bansal
    Amit Bansal http://www.oops4you.blogspot.com/

    Hi Amit Bansal,
    Thanks for posting in MSDN forum.
    This forum is for developers discussing developing issues involve Excel application.
    According to the description, you got an error when you open the document form SharePoint site.
    Based on my understanding, this issue maybe relative to the SharePoint, I would like move it to
    SharePoint 2013 - General Discussions and Questions forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • "An error occurred sending the command to the application" When trying to open excel document from outlook 2007

    Error message "An error occurred sending the command to the application" When trying to open excel document from outlook 2007.
    OS: Windows Server 2008 R2
    If I save the document then it opens fine, messing with default file associations does not resolve this problem, I've googled for ir it and some suggest unticking compatibility mode or "run as admin" for excel application, neither is selected in my case.
    Outlook is configured to run as remote application from remoteApp server, this error is only occurring for one user, for others excel documents open just fine.

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, we can Create a trusted location follow these steps
    Click the Microsoft Office Button , and then click Excel Options.
    Click Trust Center, click Trust Center Settings, and then click
    Trusted Locations.
    If you want to create a trusted location that is not local to your computer, select the Allow trusted locations on my network (not recommended) check
    box.
    Click Add new location.
     IMPORTANT   We recommended that you don't make your entire
    Documents or My Documents folder a trusted location. Doing so creates a larger target for a hacker to potentially exploit and increases your security risk. Create a subfolder within Documents or My Documents, and make only that folder a trusted location.
    In the Path box, type the name of the folder that you want to use as a trusted location, or click Browse to
    locate the folder.
    If you want to include subfolders as trusted locations, select the
    Subfolders of this location are also trusted check box.
    In the Description box, type what you want to describe the purpose of the trusted location.
    Click OK.
    More detailed information you can refer to this link:
    http://office.microsoft.com/en-us/word-help/create-remove-or-change-a-trusted-location-for-your-files-HA010031999.aspx?CTT=1#BM12
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHN
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Cannot go on suspend with an open Excel file from network

    Hi all,
    I cannot go on suspend with an open Excel file with macro - from network.
    The error msg is that I need to close all the open files first.
    "Windows cannot go on standby because Microsoft Office documents or application components are being accessed from the network. You must close the open documents or exit the application before you can put the computer on standby"
    The error msg will not appear when I use regular excel files, only with macro.
    Any ideas?
    Thanks.

    Hi,
    In regarding of the issue, there are some reasons.
    Firstly, if we got some error message like: "Cannot find the file 'C:\Folder\FileName.xls' .Make sure the path and filename are correct and that all required libraries are available."
    Please try the steps:
    Open Excel>Click on file>options>Advanced options>General tab>Uncheck the box “ignore other applications which use Dynamic Data Exchange (DDE).
    Secondly, When we try to open a Office file, it'll create a temp file in the same directory. If we have no full permission with the folder and OneDrive, we also could not open it.  Thus, we'd better make sure we
    have full permission. Please try to use the administrator account to test.
    Thirdly, please see the some general troubleshooting about Excel start issue:
    http://support.microsoft.com/kb/280504
    Hope it's helpful.
    Regards,
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • I can no longer open excel documents in my doc to go app. Error message simple reads can not open attachment. And the attachment is now a winmail.dat

    I can no longer open excel documents in my doc to go app. Error message simple reads can not open attachment. And the attachment is now a winmail.dat

    winmail.dat files usually mean the email has been sent in rich text format - you could either the person who sent it to send it in a different format e.g. plain text or HTML, or there are a few apps in the store that support it (search for winmail.date in the store).
    winmail.dat files : http://support.apple.com/kb/TS1506

  • How to switch between open excel documents?

    How do I switch between open excel documents.  I am used to windows and really miss this funciton

    The Command +` keys will switch between windows in an application
    ~Lyssa

  • Since updating ios6 i now cant open excel documents sent on my email?

    why cant i open excell documents sent via email since doing io6 update??

    CB,
    When you upgrade the Numbers app, the old version is not deleted. It is your responsibility to assure that you are using the one you want and need. Don't be too hasty in assuming that you are being somehow cheated either. The old version of Numbers is far better than the newer one, except for a few improvements to cross-platform compatibility in the "upgrade".
    Look in Applications for Numbers 3 and in Applications > iWork for Numbers 2.
    Jerry

  • Will I be able to open EXCEL documents I will frequently receive from UNI on my Macbook Pro

    Will I be able to open Excel documents sent from a PC to my Macbook Pro which is using Numbers?

    Yes you will but I would recomend to use Microsoft Office for Mac.
    I found that i didn't receive all cell information when i received files from other from PC to Mac... lot a confusion.

  • Cannot open Excel documents in Sharepoint 2010 Enterprise

    We keep having this recurring issue where sharepoint will not allow users to open Excel documents. They receive the error:
    "Unable to process the request. Wait a few minutes and try performing this operation again".
    I did some research and it turns out that a simple reboot causes the issue to subside, but it comes back again.
    Any ideas?

    ProTranslating-Frank,
    Please try these links
    You
    can set the time you want to Recycle under Recycling > Specific Times
    The solution is to disable the ASP.NET Impersonation again.
    Thread 1
    Thread 2
    Similar Blog
    Hope these will help you
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Error While opening Excel documents in browser

    Hi All,
              I have few documents in my SharePoint 2010 and most
    of them are excel documents.When the users are opening the excel work book in browser i am facing the error as below.Can any one help me how can I over come from this issue
    Thanks,
    Quality Communication Provides
    Quality Work.
    Sid

    Hello,
    I assume that you have Excel installed in your computer.
    So, I think that this error is a problem with your Internet Explorer configuration. 
    Try to open them with IE 32 bits.
    Hope this helps.

  • Use comments with several opened pdf documents?

    I love Acrobat! I currently have Acrobat 9.0, version 9.5.5. I have noticed sadly that the properties bar for comments becomes disabled when 2 or more pdf documents are opened. I have to save the editing, close all pdf documents, and re-open desired document. Is this normal or is there a feature I needed enable?
    Thanks.

    That is odd, but this old version is not compatible with the latest operating systems (Windows 7 or 8). Try to update to the latest possible version, and if you're still encountering problems you might consider upgrading to Acrobat XI, the latest version.

  • Opening excel document problem

    I have some excel documents from my PC days. They open almost identical in NeoOffice, or OpenOffice. Yet in Numbers it opens up but its in different fonts, sizing etc. I know it sounds like a formating issue. But no matter how hard I try I cannot get it t look like it does in Neo Office. Its a basic page with no real formulas on it. Its a simple daily tracker.
    ANyone have any ideas?

    It was just a suggestion to show you something about numbers because I enjoy using it.
    Deleting unused rows and columns is not an option with excel type Spread Sheets.
    Select the rows or columns, right click, delete = One tidy table
    The tables in numbers are separate. Inserting another small table onto a sheet is easy. The insert table icon should be on the tool bar & is under insert on the menu bar. There are various ones to choose from.
    S.

  • Opening Excel documents

    How do I open an Excel document sent to me via email attachment?

    Other possibilities:
    http://www.macupdate.com/info.php/id/9928
    or
    http://www.macupdate.com/info.php/id/23128
    Regards
    TD

  • Can't interact with any open windows, can't interact with flash content

    I've already tried reinstalling, resetting and deleting my profile, nothing's changed.
    I can't close any Firefox window by pressing "x", or by pressing Alt+F4, I can only close it through the task manager or task bar. Minimising or going into windowed mode is also impossible.
    If a new window opens itself (e.g. A download) I can't interact with it at all - It's visible on top of the main window, but nothing I do affects it.
    I also can't interact with flash content (like pausing a youtube video)
    There is absolutely no feedback when I try. The icon doesn't change.
    I recently reset firefox, there are no add-ons, themes etc. installed, the problem persists.
    I am running Windows 7 64bit, everything else (including other browsers) appears to be working fine and a virus scan (Avast! free version) turned up nothing.
    I'd really appreciate any help!

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

Maybe you are looking for

  • Pages, Numbers, and Keynote files as attachments in emails

    Why can't I attach a file to an email unless I export it to Word or Excel? If I create a file in Pages, Numbers, or Keynote and save it to my documents, I can't attach that file to an email. It says the file cannot be attached. If I go back to the fi

  • Multiple browser or viewer windows

    I am editing a project in the timeline with A-b roll. When viewing the track and reduce the opacity on one track at a certain point, I no longer can see the other track unless I restore the opacity. What I am getting at is that the time it takes to g

  • Why some screens are hiddens in BDC record mode?

    I'm trying to create a BDC record in VA01 transaction but in this mode some screens are hidden  just like screen "Material substitution(selecting a material)" Dynpro 800 Program "SAPMV45A" Is it possible to show this screen in BDC recorder? how can i

  • Non-GUI editing or import of automation curves?

    I would like to generate some automation curves (for track volume) outside of garageband (from simple programs that I write myself) and somehow get them into garageband projects. I can think of a couple of possible approaches: - If garageband has som

  • IMPORTING: How do I set IP 09 to Copy image files into iPhoto09 on import?

    I have a number of image files stored in folders on my desktop. How do I set iPhoto 09 to copy the files from these folders on import and not just reference the image files in the spot they currently reside? After importing these files I would like t