Open workbooks Excel from MS Access VBA, Solution for Runtime error 1004

How to open Excel workbooks file using VBA from MS access

Function bukaExcel()

    Dim xlKu As Object
     
    FullPath = CurrentProject.Path & "BIF_INVOICE.xlsm"
     Set xlKu = CreateObject("Excel.Application")

   
  
    With xlKu
        .Application.Visible = True
        .Workbooks.Open (FullPath)
    End With

End Function

Notes :

If you found error 1004 , Methode Open workbooks failed , it is because your excel file contain Macro / VBA script or perhaps ODBC data connection , what you need to do is from MS. excel file go to  Options –> Trust Center and give permission to run macro script

by :

http://freelance-it-trainer.blogspot.com
Hery Purnama 081.223344.506 , IT trainer , Excel / access VBA Macro, MS Project, Primavera,

PHP Ajax Jquery, Google Map API, Google Sketchup3D, Ubuntu, Sencha ExtJS, YII, Code Igniter,

Oracle, SQL Server,

Hery Purnama – 081.223344.506 – inhousetrainer@yahoo.com.
Freelance IT Trainer, Trainer Excel VBA Macro, Trainer Sencha ExtJS, Trainer Google Map API, Trainer SPSS, Trainer MS Project, Trainer Primavera, Trainer Google Sktechup 3D, Trainer Android Phonegap, Trainer Oracle, Trainer SQL Server, Trainer MySQL, Trainer PHP Jquery Mobile , Trainer Java, Trainer HTML5 Javascript, Trainer SEO Internet Marketing, Trainer Project Management, Trainer SMS Gateway, Trainer CMS WordPress, ITIL, COBIT

Author: Inhouse Trainer freelance

Hery Purnama 081.223344.506 - Freelance Trainer , Excel VBA Macro, Android, Phonegap, ITIL, COBIT, Google Map API, Sketchup3D , MS Project, Sencha ExtJS, Oracle , MySQL DBA, MS. Access VBA, Primavera P6, MS Project ,Jquery, Yii, CodeIgniter. laravel, CATIA 3D, Unity 5 , PMBOK, PMO, TOGAF, PRINCE2 - Call : 081.223344.506 | PinBB : 7DC633AA| Email / YM : inhousetrainer@yahoo.com | FB : inhousetrainer | TW : inhousetrainer

Leave a Reply

Your email address will not be published. Required fields are marked *