suchi rana

suchi rana

  • NA
  • 18
  • 31k

How to call Access Macros with parameters from vb.net

Jul 17 2013 5:11 AM
HI All,

I have created macro in Access DB. Now i want to run that macro from Windows Vb.net.

Here is my code....


Dim oAccess As Object



oAccess = CreateObject("Access.Application")


oAccess.Visible = True


oAccess.OpenCurrentDatabase("\\Asihydfp01n1\it\Soft\IT-US\CSSD\ITS-US-LA\Sucharitha\TestCase\TestC.mdb")



oAccess.DoCmd.RunMAcro("macro1", lbluid)oAccess.CloseCurrentDatabase()



'oAccess.Quit()


System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess)


oAccess = Nothing



************
But it won't affect in DB.
after this i am not able to open the Access DB.

Please any suggestions


Thanks in Advnace
Sucharitha