Optimize the Speed of Your PC and Fix Computer Errors!

 Windows 7 Error | Windows Vista Error | Windows XP Error | Registry Repair Help | PC Common Error
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Home   About Us   F.A.Q   SiteMap   Contact Us

You may receive runtime error 1004 error message when VBA not opening, copying worksheet ..., this page contains some useful information to repair your computer run time error code 1004, if you fixed this error from this help article, you can email us (windowsxpregistrycleaner@gmail.com ) give your feedback, and we hope you can share this page to your friends if they need like you, thanks.

 

Run-time error 1004 excel

Back to Top

  • When you try to run a Visual Basic for Applications (VBA) macro that saves the current workbook as a shared workbook in Office Excel 2007, you receive the error below:

    "Run-time error 1004, Application-defined or object-defined error"
     
  • How to fix?

    Cause:
    a. The default save format is set to Excel 97-2003. Additionally, a new workbook is added, and the macro uses the ProtectSharing method or the SaveAs method against the new workbook in the Excel 97-2003 file format.

    b. The ProtectSharing method uses the FileFormat property set to xlExcel8.


    To resolve this issue, try following methods:

    Method 1: Set the default file format to xlWorkbookNormal

    To use either the ProtectSharing method or the SaveAs method in a VBA macro, set the default file format to ExcelWokbookNormal early in your VBA macro.

    The following VBA code is an example of how to use the DefaultSaveFormat method to set the default file format to xlWorkbookNormal.
    Application.DefaultSaveFormat = xlWorkbookNormal

    Note To manually set the DefaultSaveFormat method, follow these steps:

    1. Click the Microsoft Office Button, and then click Excel Options.
    2. Click Save.
    3. In the Save files in this format box, click the format in which you want workbooks to be saved by default.
    4. Click OK to close the Excel Options dialog box.


    Method 2: Use the SaveAs method with the AccessMode parameter

    To use the SaveAs method, use the AccessMode parameter.

    The following VBA code is an example of how to use the SaveAs method with the AccessMode parameter.

    ActiveWorkbook.SaveAs FileName:="filename.xls", AccessMode:=xlShared, FileFormat:=xlExcel8

    Note The value of the FileFormat property must be the same value as the DefaultSaveFormat method.
     

Read our site other related articles...

 

Microsoft help links for windows runtime error 1004

Back to Top

 

PC tool to fix runtime-error 1004

Back to Top

 

That is we find the informations to fix pc VBA runtime error 1004 in windows, hope our page is helpful to you, if you still need more guide detail, please contact the microsoft support for further help.

 

 

www.pchealthadvisor.com

www.pchealthadvisor.com

(Simple Steps:>>Download >>Install >>Free Scan >>Repair. that's all.)

 

 

PC error? Windows error? Registry error? - Find and fix on windowsxpregistrycleaner.com. Thanks for your visiting and we wait for you using our site again in the future! :)

Search Computer Errors on Our Site


Back to Top

Run time error 1004

Home > Categories > PC Common Errors - Update: December 17, 2010

>>> VBA Run-Time Error 1004 How to Fix?
Copyright 2008 WindowsXPRegistryCleaner.com. All Rights Reserved.      

 

 Change Language

 

Subscribe Emails

PC Error Popular Articles 

PC Health Advisor Reviews
Runtime Error 13
Msvcr80d.dll Missing
User32.dll Error
Error 1327
Winword.exe Error
Explorer.exe Error
Rdpclip.exe Error
Dmadmin.exe Error

 

 PC Errors Categories 

Windows 7 Error
Windows Vista Error
Windows XP Error
Registry Repair Help
PC Common Error

 


 

This site provides the information as a service to the Internet community. We do not endorse any of the companies, products, or services
mentioned. Each product or service is the trademark of their respective company. All information is provided as opinions only.