File Left Open in Excel 2010 but not in Excel 2013 but Why?

   
Hi All,
After running the four lines of code below, if I try to open the 'MyFile.XLSX' in the windows Explorer I get a message saying  'File in use by 'another user'. However if I try to reference the file in Excel via VBA it is clearly not accessible (and
shouldn't be). So why after copying all worksheets to another workbook is it still ready only?
Is there a way of ensuring the file is writeable once again via VBA (since the object can not be referenced any longer?)
Thanks in advance of any enlightenment
Steve 
Dim pmWkBk as Workbook
Set pmWkBk = GetObject(Workbooks("MyFile.XLSX"))
pmWkBk.Sheets.Move After:=Workbooks("MyOtherFile.XLSX").Worksheets("Sheet1")
Set pmWkBk = Nothing
Steve Stretch

So, 'the original workbook no longer exists in the Excel object model'.  I don't think that's possible.
It is 100% possible because once all the sheets of a workbook have been MOVED to anther workbook the original workbook doest;t exist. try it yourself...code
below was recorded and the last line added.
Cheers
Sub Macro1()
' Macro1 Macro
    Workbooks.Open Filename:="C:\Users\Win7\Desktop\Hello.xlsx"
    Sheets("Hello").Select
    Sheets("Hello").Move Before:=Workbooks("Goodbye.xlsx").Sheets(1)
    'then the bit you say is impossible - this is where you would get a subscript out of range error
    Workbooks("Hello").Close
End Sub
Steve Stretch

Similar Messages

  • IMovie will open on a guest account but not on the primary account - why?

    iMovie will open on a guest account but not on the primary account - why?

    Maybe the parental control is activated for the guest account? Have a look in System Preferences -> Parental Control.

  • When I attempt to updates apps on my ipad my password does not work. I tried updating them one at a time and it still doesn't work. I've reset my password and I can use the new password and update apps on my PC but not on my ipad. Why?

    When I attempt to update apps on my ipad my password does not work, even when I attempt to update each app separately. When I change the password it works on my PC but not on my ipad.  Why?

    Try logging out of your account on the iPad by tapping on your id in Settings > Store and then log back in and see if it then works.

  • I can send messages to one of my contacts on my iPhone but not on my iPad. Why?

    I can send messages to one of my contacts on my iPhone but not on my iPad. Why?

    Does the contact you are sending the message to use an iPhone?
    The iPhone will send and receive both iMessages and Text messages (SMS).
    The iPad will only send and receive iMessages.
    iPads cannot receive SMS text messages.

  • I receive messages on my IPhone but not on my iPad. Why is this.? Can anyone help please?

    I receive messages from my iPhone but not on my iPad. Why is this? Can anyone help please?

    Settings>Messages>iMessage>On

  • OpenXML Excel file, works in Excel 2007, OpenOffice, etc but not in Excel 2010

    Hi everyone,
    I have a problem.  I host a free website, sharing source code and ideas with other developers.  One of my projects is a very simple C# class, which generates an Excel 2007 .xlsx file.  All source code is provided, along with a demo showing
    how to use it, free of charge.  No registration required.
    http://www.mikesknowledgebase.com/pages/CSharp/ExportToExcel.htm
    The .xlsx files that this class generates are fine, they open in Excel 2007 & OpenOffice, I've run the OpenXmlValidator
    on the files, and there are no reported problems.
    However, If I open the file in Excel 2010 (with SP1), it opens, but if I go to the Print or Print Preview screen, Excel 2010 crashes.  
    Googling around, I've found that many many users have experienced problems with HP print drivers, I followed some suggestions, such as turning off multi-threading in Excel, but it makes no difference.  I tried setting the default printer as
    the "Microsoft XPS Document Writer", but it made no difference.
    Here is a copy of the Excel file that my demo produces (and which crashes Excel 2010).   Can someone tell me why it opens okay, but then crashes Excel 2010 ?  
    http://www.MikesKnowledgeBase.com/SampleCode/Sample.xlsx
    I can get around the problem by loading this file in Excel 2010, saving it as an ".xls" file (!!) and re-loading that... but it kinda defeats the purpose.
    And, more generally, why does Excel 2007, OpenOffice and the OpenXmlValidator consider it to be in the correct format, but it crashes Excel 2010 ?  I'm surprised that Excel 2010 doesn't at least attempt to report some kind of problem with the Excel
    file, rather than bombing out.
    Mike

    It seems Workbook.XML doesn't have all the information needed by Excel for pagination while prepare for print.
    Using your sample code, here is the XML generated for Workbook.XML part within Open XML package :
    <?xml version="1.0" encoding="utf-8"?>
    <x:workbook xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
      <x:sheets>
        <x:sheet name="Drivers" sheetId="1" r:id="rId1" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" />
        <x:sheet name="Vehicles" sheetId="2" r:id="rId2" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" />
        <x:sheet name="Vehicle owners" sheetId="3" r:id="rId3" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" />
      </x:sheets>
    </x:workbook>
    Replace above content with below XML and print should work fine:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
      <fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303"/>
      <workbookPr defaultThemeVersion="124226"/>
      <bookViews>
        <workbookView xWindow="510" yWindow="510" windowWidth="4455" windowHeight="2520"/>
      </bookViews>
      <sheets>
        <sheet name="Drivers" sheetId="1" r:id="rId1"/>
        <sheet name="Vehicles" sheetId="2" r:id="rId2"/>
        <sheet name="Vehicle owners" sheetId="3" r:id="rId3"/>
      </sheets>
      <calcPr calcId="0"/>
    </workbook>
    The change is not with data but few elements which define the view for Excel. The required code change can be found using Open XML SDK tool code-reflect.
    Shiv Khare

  • Excel 2010 inplace not showing File tab

    Wondering if anyone else having an Excel 2010 inplace issue not showing the File ("Backstage") tab to allow Save or Save As operations?  Noticed others searched SAP xSearch help with similar Excel 2010 search terms but nothing relevant returned...
    We're on ERP 6.04, NW 7.01sp5, SAPGUI 7.20sp2 with Excel 2010 running on XP sp3.
    Thanks in advance (and full points) for any resolution ideas or issue confirmations before opening an OSS ticket :>

    >
    Scott Aamodt wrote:
    > Patrick,
    >
    > In response to your Excel 2010 issue above our users have not had similar "crash" issues at all in the SAP technical environment I originally posted above.  If you have the same EHP4 and SAPGUI 7.20 as we and have that issue I'd check your Excel installation again before opening a ticket with SAP.
    >
    > Scott
    Is the "File"-Button now working in your environment or not?
    (We don't use SAPGui 7.10 and EHP ... but we will upgrade in a few month)
    Note 1408098 looks like there is no solution for the crash-issue, right?
    The only solution/workaround is to put the icons into the quickmenu-bar.
    Best Regards,
    Patrick

  • BW 3.5 / GUI 7.20 / Excel 2010 : RRMX not working properly

    Hi,
    We are here working on BW 3.5 with GUI 7.20 FEP 2.
    BEx 3.5 is being used on Office 2010.
    When we run a workbook from SAP GUI (user menu), then Excel 2010 is opening but:
    - Thereu2019s no automatic connection to BW as it should.
    - The workbook doesn't show up.
    - We have the following message in the SAP GUI status bar: "Please install Excel as a viewer".
    Same thing happens when we run RRMX alone.
    Any idea on how to correct that bug would be greatly appreciated!
    Regards,
    John

    Hi,
    This is an installation issue. reinstall both the Excel 2010 and SAP GUI7.20 with latest patch along with .net component also.
    For an intermediate solution, just copy the file "BExAnalyzer.xla" (normally located in "C:\Program Files\SAP\Business Explorer\BI") to the path "C:\Program Files\Common Files\SAP Shared\BW".
    Or  follow the steps given in the below link
    http://www.sytecpa.org/software/BWInstructions/Installing%20the%20SAP%20BEx%20Analyzer%20Excel%20Add-In.pdf
    Also check the below note for more info.
    Note 1078523 - RRMX problems when using BI 7.X AddOn based on SAPGUI 7.10
    Regards
    KP

  • Can I programmatically force saving an XLTM template to save as an XLSM file in Excel 2010 without defaulting all Excel file types?

    I created an Excel template which includes VB and macros as an EXCEL.XLTM template file (I used a template file to keep users from overwriting the sample template file), but I have noticed that when users save the template, Excel 2010 defaults to saving
    the new file as a XLSX file (removing all the macros).
    I know you can set Excel 2010 to always save as a certain format, but I really would prefer not forcing all Excel files to be macro enabled for the user
    Is there a way to default the Save type to XLSM for this template only?  Like some code that I could put in that when the users saves, it saves as a macro enabled XLSM type only for this template file?
    My users aren't exactly Excel savvy, so I wanted to make it as simple as possible for them.
    Thanks!
    Alan Edwards

    Hi Alan,
    >> Is there a way to default the Save type to XLSM for this template only?  Like some code that I could put in that when the users saves, it saves as a macro enabled XLSM type only for this template file?
    In my option, you could achieve this by adding Application.GetSaveAsFilename Method to the workbook BeforeSave event. Some key code like below:
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Dim FileNameVal As String
    If SaveAsUI Then
    FileNameVal = Application.GetSaveAsFilename(, "Excel Macro-Enabled Workbook (*.xlsm), *.xlsm")
    Cancel = True
    If FileNameVal = "False" Then 'User pressed cancel
    Exit Sub
    End If
    ThisWorkbook.SaveAs Filename:=FileNameVal & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
    Application.EnableEvents = True
    End If
    End Sub
    But there is a limitation of this workaround, in this workaround, the save as will only support the macro enabled type, other save as types like "xlsx" will be ignored.​
    For more information about Application.GetSaveAsFilename Method (Excel), you could turn to the link below:
    #Application.GetSaveAsFilename Method (Excel)
    https://msdn.microsoft.com/en-us/library/office/ff195734.aspx
    Best Regards,
    Edward
    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.

  • PDFMaker in Excel 2010 does not appear after installing Adobe Acrobat 9 Standard

    I installed Adobe Acrobat 9 Standard for a user here at work on her computer with Windows XP and Office 2010 installed. She wanted the feature and/or plug-in that allows her to "Save as Adobe PDF" in Excel 2010 and then able to add/remove pages from a spreadsheet in Excel 2010 like this:
    Which brings it to this screen:
    We saw this feature with someone who has Acrobat X Standard. Is this feature available in Acrobat 9? If so, how do we enable it? We updated Acrobat 9 and nothing showed up.

    The PDFMaker function of Acrobat 9 is not compatible with Office 2010: http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html
    You can use Acrobat 9 to create PDF files though by choosing File > Print within Excel and selecting the Adobe PDF printer. 
    Wish I had better news for you!
    Please let us know if you have any questions.
    -David

  • Excel File [.xlsx] of more than 5 MB - Not applying Excel Display Template

    Hi Team,
    We have an issue in SharePoint 2013 Search Results for Excel files having extension .xlsx format. Some files which are having more than 5 MB size are not applying Excel display template. Even we are not getting Excel icon beside the Search result of this
    item.
    For all other excel files like [All sizes of .xls format and files less than 5 MB of .xlsx format] Excel display template is applying.
    Can anyone help me on this. Do we have any issues/limitations on file size for Search Results.
    Thanks, Dinesh
    Dinesh Pulugundla, Microsoft Certified Technology Specialist.

    Hi Dinesh,
    Yes,SharePoint Search crawl component downloads metadata and content from a document until it reaches the maximum document size. For Excel documents, the maximum document size is 3MB. And you can change the limit for the maximum document size, but it does
    not affect Excel documents.
    Reference:
    http://technet.microsoft.com/en-us/library/cc262787(v=office.15).aspx#Search
    Thanks,
    Eric
    Forum Support
    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 Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • The attach a file button (in netzero e-mail) does not work in firefox but does in explorer

    The "attach file button" (in net zero e-mail) does not work in firefox but does in explorer.
    == URL of affected sites ==
    http://

    *Tools > Options > Privacy > History: Firefox will: "Use custom settings for history"
    *Tools > Options > Privacy > History: "Remember search and form history"
    See also [[Form autocomplete]]

  • Repeating headers in PDF report but not in Excel format?

    Is it possible to have repeating headers on PDF output format, but not if the report output is Excel ?

    If the report is simple, i.e. it only contains a single table, then you can add some header rows at the top of the table.
    +-----------------------+ 
    | Page Header 1         |  }
    +-----------------------+  }
    | Page Header 2         |  }
    +-----------------------+  }
    | Page Header 3         |  }
    +-----------------------+  }--Repeat as header row at
    |      <Blanks>         |  }  the top of each page
    +-----------------------+  }
    |      <Blanks>         |  }
    +-----------+-----------+  }
    | Heading 1 | Heading 2 |  }
    +-----------+-----------+ 
    | Data 1    |  Data 2   |
    +-----------+-----------+

  • Switch Linked (xl source) Tables - behavior change Excel 2010 PP vs. Excel 2013 PP -- In 2013 all calcs of table are lost

    Situation:
    PowerPivot 2010 Model based on 10 linked tables (this tables are generated and refreshed as needed by SQL 2012 MDS Excel-AddIn)
    Unfortunately Excel MDS AddIn changes sometimes the tablename (case: MDS Add-In Filter changed, MDS Server changed). So after Change of tablename we have to fix the powerpivot link to this Excel tables in powerpivot to get powerpivot refresh working again
    Problem:
    With Excel 2010 PowerPivot this was possible without big Problems. As Long as table has identical structure one can Change/Switch the table in powerpivot Windows > Ribbon "Linked" Table > DropDown "Linked Table X" or during update
    via Dialog "Errors in Linked Table"
    After upgrading the solution to Excel 2013 this is not possible any more without loosing any column- or measure calcs defined for this table! :( Every time you Change the assigned Excel table for an existing linked powerpivot table..you
    get following Dialog:
    "You are changing the source of X to Excel table Y. Changing the source will remove all formatting, measures, KPIs, hierarchies, and other Settings applied to the table. Are you sure you want to to continute?"
    Does anyone found a Workaround for persisting existing calc of linked tables when changing the sourcetable (to another Excel table with same structure)??
    Dear MS, this is IMHO really a step backwards and blocks the migration of our existing Excel 2010 PowerPivot Solution? Should i create a connect entry for that?!
    Version-Info:
    2010 Version: 11.0.3000.0 (PP Ribbon>Settings)
    2013 Version: 11.0.2809.81 (Product version displayed for dll c:\program files\Microsoft Office\Office15\Addins\PowerPivot excel Add-In\PowerPivotExcelClientAddIn.dll)

    There is a very similar issue discussed here where i tried to show the different behavior in terms of linked tables in Excel/PowerPivot 2010 vs 2013
    http://social.technet.microsoft.com/Forums/en-US/8fd927f7-30fd-49b7-809c-cb1414955638/linked-tables-excel-2013-vs-2010-difference?forum=sqlkjpowerpivotforexcel
    maybe it helps you to understand the issue
    I assume that MDS creates a new table every time you refresh it thereby breaking the link to PowerPivot
    in case you only have calculated measure you may created a separate, independent linked table and define all calculated measures there
    this way they at least would not get removed
    hth,
    gerhard
    Gerhard Brueckl
    blogging @ http://blog.gbrueckl.at
    working @ http://www.pmOne.com

  • "want to save your changes" just after opening a xls, is continuing even with Office 2013 but didn't come in office 2003.

    hi everyone,
    Is there any microsoft article which provide information regarding this issue.
    thank you in advance
    regards
    arun av

    Hi arun av,
    According to your description, you opened the previous excel file in new version of Excel. Did you get the dialogue box as shown in the figure when close the file?
    Ideally, the issue is caused when the first time you open a file that was last saved in a previous version of Excel, the file is completely recalculated. For more information about Excel fully recalculating workbooks when they are opened for the first time,
    you can refer to following links:
    https://support.microsoft.com/en-us/kb/210162
    https://support.office.com/en-sg/article/Change-formula-recalculation-iteration-or-precision-73fc7dac-91cf-4d36-86e8-67124f6bcce4#bmlearn_about_calculating_workbooks_tha
    Hope it’s helpful.
    Regards,

  • Movie loads on Firefox but not IE (surprise?), but also not in Safari??

    I am a novice, but it's hard to do anything wrong using iWeb. I tried sharing a movie made in iMovie to iWeb on my .mac account. The movie only plays on a Mac (or PC) using Firefox. Both IE (what a surprise! joke...) and Safari will not load the movie. It's 8.2 MB, orig size about 3.2 GB. It's understandable that the movie might not load on IE, but Safari - same Mac used to create the site. Note: it does load in Safari, if I am simultaneously running Firefox and have the page with the movie open and loaded, otherwise it just hangs and shows the big Q for Quicktime, but no movie... Any ideas. PS. When I send the updated site to a folder on my Mac, it works fine, but when I post it to .mac, no go.
    Thanks for any help for this novice.

    I am a novice, but it's hard to do anything wrong using iWeb. I tried sharing a movie made in iMovie to iWeb on my .mac account. The movie only plays on a Mac (or PC) using Firefox. Both IE (what a surprise! joke...) and Safari will not load the movie. It's 8.2 MB, orig size about 3.2 GB. It's understandable that the movie might not load on IE, but Safari - same Mac used to create the site. Note: it does load in Safari, if I am simultaneously running Firefox and have the page with the movie open and loaded, otherwise it just hangs and shows the big Q for Quicktime, but no movie... Any ideas. PS. When I send the updated site to a folder on my Mac, it works fine, but when I post it to .mac, no go.
    Thanks for any help for this novice.

Maybe you are looking for

  • Some Apps don´t appear in my apple tv

    Have two apple tvs in my home, one displays VEVO, HBO GO and other apps, but the second one, which I recently installed and updated, doesn´t have those apps. Why is this? How can I solve it?

  • Problem in using offset value in streams

    hi friends, I have been having this problem far few hours. I am unable to understand why this exception is comming, although I know the cause of exception as I have figured it out by now but unable to remove it. here is a simple file copy program usi

  • Weird google calendar issue on iPhone 5/iOS 6.1

    Hey all, So I just noticed an issue on my new iPhone 5 w/ iOS 6.1: I use a google calendar with several shared calendars from co-workers. In the past, to set this up, all I did was add a gmail account as an Exchange account, go to https://www.google.

  • Servlet applet communication

    I'm having a problem getting a servlet to answer a call from an applet...in the applet I do something like: String servlet = "http://192.168.123.148/root/MyServlet.class"; url= new URL(servlet); conn = url.openConnection(); conn.setUseCaches(false);

  • Webutil package don't save and load files

    As above, nothing happens but there are no errors. Anybody knows why ?