Microsoft.Office.Interop.Excel

Which forum should I use to ask questions about using C# & Microsoft.Office.Interop.Excel for spreadsheets?
Rob E.

Hello,
I'd ask in the
Excel for Developers forum.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

Similar Messages

  • BPC 7.5 NW Processing Dimensions Microsoft.Office.Interop.Excell issue

    Hi
    I've tried all the downloads (service Packs, Interop Files etc) mentioned in all websites and posts to try and fix following error:
    "Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel_Application'. This Opperation failed because the Query Interface call on the COM component for the interface with ID '{000208D5-0000-0000-C000-0000000000046}' failed due to the following error: Library not registered.
    I get this only when I try to Process a dimension
    Please can anyone tell me how to fix this?
    We have installed BPC 7.5 NW
    I had Office 2010 and could process but my input schedules didn't work 100% on Office 2007 so I had to go back to 2007. And now I can't process in the Admin Client. I've uninstalled and reinstalled Office and BPC 7.5 NW SP07 a few times to try and solve this but no luck.
    Thanks
    Johan Fourie

    Hi,
    If you are using excel 2007, you need to install the redistributable primary interop assembly from the below link:
    https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3134363332383926
    Hope this helps.

  • File or assembly name microsoft.office.interop.excel or one of its dependen

    Hi Team,
    When i click on the manage dimension members for a dimension i am getting the following error,
    "file or assembly name microsoft.office.interop.excel or one of its dependencies was not found"
    How i can resolve this?
    Regards,
    Raj,

    Hi Raj,
    What did you do exactly to resolve this issue? Are you no longer using Office 2007 or did you reinstall it? What are the specific steps you took?
    I recently upgraded from SP02 to SP07 and now have the same problem. It was working fine prior to the upgrade.
    Thanks,
    Rob
    Edited by: Rob Delong on Feb 19, 2010 3:42 AM

  • On cleanuing up COM object when using Microsoft.Office.Interop.Excel

    When using Microsoft.Office.Interop.Excel the COM objects that are created by the code must be released using System.Runtime.InteropServices.Marshal.ReleaseComObject().
    Most of the time it's pretty clear when a new COM object is created such as:
    Excel._Application excelApp = null;
    Excel._Workbook wb = null;
    Excel._Worksheet ws = null;
    Excel.Range newRange = null;
    try
    // four COM objects are created below
    excelApp = new Excel.Application();
    wb = excelApp.Workbooks.Add();
    ws = (Excel.Worksheet)wb.Worksheets.Add();
    newRange = (Excel.Range)ws.Range["A1","A30"];
    // do these line of cod create new COM object?
    newRange.Font.Bold = true;
    newRange.Borders.Color = borderColor;
    finally
    if (excelApp != null) Marshal.ReleaseComObject(excelApp)
    if (wb != null) Marshal.ReleaseComObject(wb)
    if (ws != null) Marshal.ReleaseComObject(ws)
    if (newRange != null) Marshal.ReleaseComObject(newRange)
    In the above code I create four COM objects in the first part that need to be released when I'm finished with them. But it's not clear if the other two lines of code create a new COM object or not.  If they do then my code needs to look more
    like this:
    Excel._Application excelApp = null;
    Excel._Workbook wb = null;
    Excel._Worksheet ws = null;
    Excel.Range newRange = null;
    Excel.Font fnt = null;
    Excel.Borders bds = null;
    try
    // four COM objects are created below
    excelApp = new Excel.Application();
    wb = excelApp.Workbooks.Add();
    ws = (Excel.Worksheet)wb.Worksheets.Add();
    newRange = (Excel.Range)ws.Range["A1","A30"];
    // do these line of cod create new COM object?
    fnt = newRange.Font
    fnt.Bold = true;
    bds = new newRange.Borders;
    bds.Color = borderColor;
    finally
    if (excelApp != null) Marshal.ReleaseComObject(excelApp)
    if (wb != null) Marshal.ReleaseComObject(wb)
    if (ws != null) Marshal.ReleaseComObject(ws)
    if (newRange != null) Marshal.ReleaseComObject(newRange)
    if (fnt != null) Marshal.ReleaseComObject(fnt)
    if (bds != null) Marshal.ReleaseComObject(bds)
    How can I tell if getting a property creates a new COM object or not?

    Thank you for your replay but I do understand that the font object is a COM object.  What I'm trying to figure out is if a NEW object is created each time I access the font member of a Range object and if I need to call
    Marshal.ReleaseComObject on the font object after using it.
    Most member object of an object are a single instance and each time you access the member you simply get the pointer to that instance. For example:
    using(DataTable dt = new DataTable("Some Table Name"))
    PropertyCollection ep1 = dt.ExtendedProperties;
    PropertyCollection ep2 = dt.ExtendedProperties;
    if (Object.ReferenceEquals(ep1,ep2)) Console.WriteLine("They are the same object");
    else Console.WriteLine("They are different objects");
    The output will be: They are the same object
    On the other hand this:
    Excel._Application excelApp = new Excel.Application();
    Excel._Workbook wb = excelApp.Workbooks.Add();
    Excel._Worksheet ws = (Excel.Worksheet)wb.Worksheets.Add();
    Excel.Range newRange = (Excel.Range)ws.Range["A1","A30"];
    // do these lines of code create new COM object?
    Excel.Font ef1 = newRange.Font;
    Excel.Font ef2 = newRange.Font;
    if (Object.ReferenceEquals(ef1,ef2)) Consloe.WriteLine("They are the same object");
    else Consloe.WriteLine("They are different objects");
    The output will be: They are different objects
    It looks like each time I access the font member I get a new object.  I suspect that is not the case and what I am getting is two pointers to the same object and the reference counter is incremented by one.
    So really the question is what happens to the font member object of the Range object when the range object is released.  I assume the font member will be released along with the Range object ever if the font object has a reference count greater then
    0.
    If I am correct in my assumption then I can access the font member object as much as I need to without worrying about releasing it.
    I have been reading a lot about working with COM and the need to use Marshal.ReleaseComObject and there does seem to be a lot of disagreement and even confusion on the
    mater about when and if COM objects need to be explicitly released.

  • Help and some explanation how to get a Microsoft.Office.Tools.Excel.Worksheet host item that extends the functionality of the current Microsoft.Office.Interop.Excel.Worksheet object

    Hello,
    I would use some help and more info about how to get host object that extends the functionality of my current Interop.Excel.Worksheet object. I read this artical: https://msdn.microsoft.com/en-us/library/ee794671.aspx where I can call this function
    GetVstoObject to get host object. But I see that here I need to pass the Globals.Factory object as second parametar. Can someone give me more details about that parameter and how to access it? I would like to get host object so I can access extension
    property, since my interop excel worksheet doesn't have it.  
    I am using Visual Studio 2013 for developing Excel addin. Using Excel 2010.
    Thanks in advance for help.
    Regards,
    Zeljka

    Hi Zeljka,
    >>I am using the Microsoft Office PIAs, so my question is how to access this automatic generated class Globals in my case?   <<
    Sorry, I am not able to understand the application you were developing exactly. From the orgnal post, you were developing an application level add-in, however based on the description above, it seems that you were building an console or Windows form application
    to automate Office application.
    If you were developing Office automation, the host item can't work for this secnario since it should run under the VSTO runtime.
    If I misunderstood, please feel free to let me know.
    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.

  • Basic question regarding SSIS 2010 Package where source is Microsoft Excel 97-2005 and there is no Microsoft office or Excel driver installed in Production

    Hi all,
    I got one basic question regarding SSIS 2010 Package where source is Microsoft Excel 97-2005. I wanted to know How this package works in production where there is no Microsoft office or Excel driver installed. To check that there is excel driver installed
    or not, I followed steps: Start-->Administrative Tools--> Data Sources(ODBC)-->Drivers and I found only 2 drivers one is SQL Server and another one is SQL Server Native Client 11.0.
    Windows edition is Windows Server 2008 R2 Enterprise, Service Pack-1 and System type is 64-bit Operating System.
    We are running this package from SQL Server Agent and using 32-bit (\\Machine_Name\d$\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\DTExec.exe /FILE "\\Machine_Name\d$\ Folder_Name\EtL.dtsx" /CONFIGFILE "\\Machine_Name\d$\Folder_Name\Config.dtsConfig"
    /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E) to run this package. I opened the package and tried to find out what connection we have used and found that we have used "Excel Connection Manager" and ConnectionString=Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=F:\Fares.xls;Extended Properties="EXCEL 8.0;HDR=YES"; and source is ‘Excel Source’
    I discussed with my DBA and He said that SSIS is having inbuilt Excel driver but I am not convinced.
    Could anyone please clear my confusion/doubt?
    I have gone through various links but my doubt is still not clear.
    Quick Reference:
    SSIS in 32- and 64-bits
    http://toddmcdermid.blogspot.com.au/2009/10/quick-reference-ssis-in-32-and-64-bits.html
    Why do I get "product level is insufficient..." error when I run my SSIS package?
    http://blogs.msdn.com/b/michen/archive/2006/11/11/ssis-product-level-is-insufficient.aspx
    How to run SSIS Packages using 32-bit drivers on 64-bit machine
    http://help.pragmaticworks.com/dtsxchange/scr/FAQ%20-%20How%20to%20run%20SSIS%20Packages%20using%2032bit%20drivers%20on%2064bit%20machine.htm
    Troubleshooting OLE DB Provider Microsoft.ACE.OLEDB.12.0 is not registered Error when importing data from an Excel 2007 file to SQL Server 2008
    http://www.mytechmantra.com/LearnSQLServer/Troubleshoot_OLE_DB_Provider_Error_P1.html
    How Can I Get a List of the ODBC Drivers that are Installed on a Computer?
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/07/07/how-can-i-get-a-list-of-the-odbc-drivers-that-are-installed-on-a-computer.aspx
    Thanks Shiven:) If Answer is Helpful, Please Vote

    Hi S Kumar Dubey,
    In SSIS, the Excel Source and Excel Destination natively use the Microsoft Jet 4.0 OLE DB Provider which is installed by SQL Server. The Microsoft Jet 4.0 OLE DB Provider deals with .xls files created by Excel 97-2003. To deal with .xlsx files created by
    Excel 2007, we need the Microsoft ACE OLEDB Provider. SQL Server doesn’t install the Microsoft ACE OLEDB Provider, to get it we can install the
    2007 Office System Driver: Data Connectivity Components or
    Microsoft Access Database Engine 2010 Redistributable or Microsoft Office suit.
    The drivers listed in the ODBC Data Source Administrator are ODBC drivers not OLEDB drivers, therefore, the Excel Source/Destination in SSIS won’t use the ODBC driver for Excel listed in it by default. On a 64-bit Windows platform, there are two versions
    of ODBC Data Source Administrator. The 64-bit ODBC Data Source Administrator is C:\Windows\System32\odbcad32.exe, while the 32-bit one is C:\Windows\SysWOW64\odbcad32.exe. The original 32-bit and 64-bit ODBC drivers are installed by the Windows operating system.
    By default, there are multiple 32-bit ODBC drivers and fewer 64-bit ODBC drivers installed on a 64-bit platform. To get more ODBC drivers, we can install the 2007 Office System Driver: Data Connectivity Components or Microsoft Access Database Engine 2010 Redistributable.
    Besides, please note that 2007 Office System Driver: Data Connectivity Components only install 32-bit ODBC and OLEDB drivers because it only has 32-bit version, but the Microsoft Access Database Engine 2010 Redistributable has both 32- bit version and 64-bit
    version.
    If you have any questions, please feel free to ask.
    Regards,
    Mike Yin
    TechNet Community Support

  • Microsoft.Office.Interop.Word error on Windows Server 2008 R2

    Hi,
    I have Microsoft Office 2003 installed on Windows Server 2008 R2. I get a "There is insufficient memory. Save the document now." error while adding a document to the Microsoft.Office.Interop.Word.Document class as in the code below. I can see the Memory
    consumption shoots up as soon as the following lines of code is executed. Surprisingly, this same piece of code works fine on Windows Server 2008.
    Object missing = System.Reflection.Missing.Value;
    Object oFalse = false;
    Microsoft.Office.Interop.Word.Application oWord = new Application();
    Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
    oWordDoc = oWord.Documents.Add(ref missing, ref missing, ref missing, ref missing); //The code fails here
    oWordDoc.Close(ref oFalse, ref missing, ref missing);
    oWord.Quit(ref missing, ref missing, ref missing);
    Can someone help on this?
    Thanks,
    Tarun

    Hi,
    I suggest discussing this issue in Word or IIS forum.
    Word forum:
    http://social.technet.microsoft.com/Forums/en-us/word/threads
    IIS forum:
    http://forums.iis.net/
    Tim Quan

  • How to add text vertically into a Word margin with C# (using namespace: Microsoft.Office.Interop.Word)

    I need to add text vertically in a word document outside the margins.  How can I do this with Microsoft.Office.Interop.Word and C#?
    Leonard Swarczinski Software Developer Postal Center International

    Hi Leonard,
    According to your description, do you want to add text vertically into Page Header/Footer? I wrote a sample  for you.
    using Microsoft.Office.Core;
    using Microsoft.Office.Interop.Word;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace AddTextToWord
    class Program
    static void Main(string[] args)
    CreateNewDocument();
    Console.ReadLine();
    private static void CreateNewDocument()
    Object oMissing = System.Reflection.Missing.Value;
    Microsoft.Office.Interop.Word.Application oWord;
    Microsoft.Office.Interop.Word.Document oDoc;
    oWord = new Microsoft.Office.Interop.Word.Application();
    oWord.Visible = true;
    oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    String HeaderText = "Hello everyone!";
    WdParagraphAlignment wdAlign = WdParagraphAlignment.wdAlignParagraphCenter;
    AddHeader1(oWord, HeaderText, wdAlign);
    private static void AddHeader1(Application WordApp, string HeaderText, WdParagraphAlignment wdAlign)
    Object oMissing = System.Reflection.Missing.Value;
    WordApp.ActiveWindow.View.Type = WdViewType.wdOutlineView;
    WordApp.ActiveWindow.View.SeekView = WdSeekView.wdSeekPrimaryHeader;
    Microsoft.Office.Interop.Word.Shape textBox = WordApp.ActiveDocument.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationVertical, 150, 10, 40, 40);
    textBox.TextFrame.TextRange.Text = HeaderText;
    WordApp.ActiveWindow.View.SeekView = WdSeekView.wdSeekMainDocument;
    If I misunderstood or anything wrong, please let me know and you can get more information from below articles.
    Office development in Visual Studio
    http://msdn.microsoft.com/en-us/office/hh133430.aspx
    Abhout: AddTextbox Method
    http://msdn.microsoft.com/en-us/library/office/aa171543(v=office.11).aspx
    How to: Programmatically Insert Text into Word Documents
    http://msdn.microsoft.com/en-us/library/vstudio/6b9478cs.aspx

  • I created a spreadsheet using Microsoft office 2010 Excel.  When I open the sheet using Numbers, the formatting changes.  How do I fix this?

    I created a spreadsheet using Microsoft office 2010 Excel.  When I open the sheet using Numbers, the formatting changes.  How do I fix this?

    If you plan to share or work with people who regulary use MS Excel you should not try to use this in Numbers.  You will have constant problems with how each program translates the formatting.
    If you want to use Numbers, use it exclusively.  If it is for your job use the tool your company uses.

  • PowerShell, Office 2007: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Interop.Wor‌​d")

    Hi All,
    I have problem to convert word document in to html (Office 2007)
    Interop Assembly appear to work but powershell returns:
    Unable to
    find type [Microsoft.Office.Interop.Word.WdSaveFormat]:  
    I'using :
    $saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], “wdFormatFilteredHTML”);

    Hi Bill,
    Thank for your reply.
    I found this usefull script: http://gallery.technet.microsoft.com/office/6f7eee4b-1f42-499e-ae59-1aceb26100de
    On W7 + Office 2010 Works fine with no errors
    ONLY On W7 + Office 2007  returns "Unable to
    find type [Microsoft.Office.Interop.Word.WdSaveFormat]:"
    Interop Ass. same to work, only "save format" have potential strange issue.
    I don't understand why with Office 2007 only ...

  • How to install & use microsoft office (word,excel,powerpoint) in ipad?

    1.How to install & use microsoft office (word, excel, powerpoint) in ipad?
    2. How to delete applications in ipad once it is installed?

    Microsoft  Office won't work on iPad.
    Try Apps like:
    1. Documents To Go
    2. Quick Office Pro HD
    3. Office2 HD

  • Error 1310. Error writing to file: Policy.12.0.Microsoft.Office.Interop.Access.dll AHHHHHH!!!

    I'm trying to install Office 2010 Professional Plus on Windows 7 Ultimate
    I keep getting this error and I'm at witts end
    Error 1310. Error writing to file: Policy.12.0.Microsoft.Office.Interop.Access.dll.
    Verify that you have access to that directory
    I have completely uninstalled Office 2007, ran CCLeaner, Windows Install Cleanup, followed the idea's on the forums
    http://social.technet.microsoft.com/Forums/en-US/office2010/thread/4e8beb60-ac2b-4fc5-b510-628b65d7cc67
    WTH? I get the same error no matter what I do, Can anyone PLEASE help?

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    Follow these methods one by one test this issue:
    1.      
    Complete uninstall previous version of office: 
    http://support.microsoft.com/kb/290301
    2.      
    troubleshoot a problem by performing a clean boot in Windows 7
    http://support.microsoft.com/kb/929135
    3.      
    Test with a new user account
    Ÿ  
    Create a user account
    Ÿ  
    Fix a corrupted user profile
    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.
    Best regards
    William Zhou
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Just upgraded to Lion, how can i use my microsoft office especially excel.  I'm getting messages that it's no longer supported.  This is a BIG problem.  Help, please.

    Just upgraded to Lion, how can I use my microsoft office especially excel.  I'm getting messages that it's no longer supported.  This is a BIG problem.  Help, please.

    Apple has made a serious error not advising people when the Lion upgrade occurs that their present software may/will not be compatible and advise the user of such before and allow a opt out.
    All you can do (besides upgrading all your software) is backup your data off the machine (not to TimeMachine) and disconnect all drives.
    Hold c boot off the 10.6 disk and erase your makers hard drive on the far left, (that's the entire drive of everything)
    Partition tab: Option: GUID, format OS X extended and click apply so you get a new GUID (replacing the Lion one or trouble occurs later)
    Quit and install 10.6, then go through setup and use the same name as before, then update to 10.6.8
    Then c boot off the 10.6 disk again and use Disk Utility to Repair the disk the 10.6.8 update messed up.
    Then install all your programs again from fresh sources and lastly your user files in the same main user folders as before (music, pictures, documents etc.)
    Done as described will get you back just like it was before as close as possible, make SURE to use the same username or else your iTunes and other files get all messed up. Password and drive name can be different though if you wish.
    Note: if you've upgraded from 10.5 to 10.6, then you don't get the free iLife as it's not on the 10.6.3 white disks, only on the disks that came with your machine. So that will have to be purchased and reinstalled or use Pacifist to extract it from the 10.5 disks.
    This handy site can advise you what software doesn't work with the Lion.
    http://roaringapps.com/apps:table

  • Datamining PST Files using Microsoft.Office.Interop.Outlook

    I was wondering how to datamine a pst file beyond it's primary folders to see if an empty folder has content in a subfolder and add it to an existing psobject?
    Cheers,
    B.
    $results = New-Object System.Collections.ArrayList # Empty Array
    $null = Add-type -assembly Microsoft.Office.Interop.Outlook
    $outlook = new-object -comobject outlook.application
    $namespace = $outlook.GetNameSpace('MAPI')
    $pstpath = "d:\sample.pst"
    $namespace.AddStore($pstpath)
    $PST = $namespace.Stores | ? {$_.FilePath -eq $pstpath}
    $PSTRoot = $PST.GetRootFolder()
    $PSTName = $PST.Displayname
    Foreach ($folders in $PSTRoot.Folders) {
    $x = $folders.Name
    $y = $folders.FolderPath
    $z = $folders.Items.Count
    $Object = New-Object PSObject
    $Object | Add-Member -Name 'Name' -MemberType Noteproperty -Value $x
    $Object | Add-Member -Name 'Path' -MemberType Noteproperty -Value $y
    $Object | Add-Member -Name 'Items' -MemberType Noteproperty -Value $z
    $results += $object
    $results | Format-Table 'Name','Path','Items' -Wrap -AutoSize | Out-Default
    $results = $NULL

    Hi B,
    If you want to test the access of the .pst file, please refer to the function below:
    function Test-PSTFile {
    param(
    [Parameter(Position=1, ValueFromPipeline=$true, Mandatory=$true)]
    $FilePath,
    [Parameter(Position=2, Mandatory=$false)]
    $ErrorLog
    process {
    #Create an instance of Outlook
    $null = Add-type -assembly Microsoft.Office.Interop.Outlook
    $olFolders = 'Microsoft.Office.Interop.Outlook.olDefaultFolders' -as [type]
    $outlook = new-object -comobject outlook.application
    #Open the MAPI profile
    $namespace = $outlook.GetNameSpace('MAPI')
    try {
    #Try to add the PST file to the profile
    $namespace.AddStore($FilePath)
    #Try to read the root folder name
    $PST = $namespace.Stores | ? {$_.FilePath -eq $FilePath}
    $PSTRoot = $PST.GetRootFolder()
    if($PSTRoot) {
    New-Object PSObject -Property @{
    FileName = $FilePath
    Valid = $True
    #Disconnect the PST
    $PSTFolder = $namespace.Folders.Item($PSTRoot.Name)
    $namespace.GetType().InvokeMember('RemoveStore',[System.Reflection.BindingFlags]::InvokeMethod,$null,$namespace,($PSTFolder))
    catch {
    #If logging is on, save the error to the log
    if($ErrorLog) {
    Add-Content -Path $ErrorLog -Value ("Ran into a problem with {0} at {1}. The error was {2}" -f $FilePath, (Get-Date).ToString(),$_.Exception.Message)
    #Output a failure record
    New-Object PSObject -Property @{
    FileName = $FilePath
    Valid = $False
    Refer to:
    How to Test Outlook (PST) Personal Folder File Access with PowerShell
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang

  • Important Microsoft Office 2011 Excel File isn't opening Please Help!

    Hello everyone,
    I'm having problems opening one single excel file. I've tried others and they open with no issue. This file I'm trying to open now opened 2 days ago as it's a project I've been working on and I desperately need to get back to working on it!
    I'm running OS X 10.8.4 on a Macbook Pro with Microsoft Office 2011. When I open the workbook it loads the progress bar, then doesn't show anything from excel apart from the top bar with file/edit/view... etc
    When I try and open it from this point it gives me a message
    'XXX.xlsx is already open.
    Reopening will cause any changes you made to be discarded. Do you want to reopen XXX.xlsx
    PLEASE HELP and don't hesistate to ask for anymore information if you need it. Thank you.

    Such instances are examples of why one should maintain good backups.  I suggest you consider using Time Macnine backups.  It would allow you to go back in time to earlier versions of the file if a later one is corrupted or if you save unwanted changes by mistake.
    You would need a $80 external disk drive for the Time Machine volume.  Your data is much more valuable than that $80 cost.  Disks can fail at any time, taking all of your data with them.
    Time Machine Basics: http://support.apple.com/kb/ht1427
    Most commonly used backup methods: 
    https://discussions.apple.com/docs/DOC-3045

Maybe you are looking for