Error "1004" = Cannot Access CurrentDispatch.xls and then "440" in

L

ldiaz

I'm running a macro from a Form in access but now it's showing an error
Error "1004" = Cannot Access CurrentDispatch.xls in the excel code
I click End and then appear other error in my Access code.
and then "440" in Acc


the macro file is located in a shared drive \\asdec\\ss$
("B:\Shipment System DB\Shipment System\Utilities\")
but it open another file that is located in the same shared drive \\asdec\\ss$
"B:\Shipment System DB\Shipment System\Current Dispatch File"

please help.....


this is the code in my excel macro
... to open another file named: CurrentDispatch.xls
=================================================
ChDir "B:\Shipment System DB\Shipment System\Current Dispatch File"
Workbooks.Open Filename:= _
"B:\Shipment System DB\Shipment System\Current Dispatch
File\CurrentDispatch.xls"
=================================================


and this is my code on my form
==============================================
Private Sub RunEMac_Click()

Dim xls As Object, xwkb As Object
Dim strFile As String, strMacro As String
strFile = "ShippingMacro.xls"
strMacro = "Shipping"
Set xls = CreateObject("Excel.Application")
xls.Visible = True
Set xwkb = xls.Workbooks.Open("B:\Shipment System DB\Shipment
System\Utilities\" & strFile)
xls.Run strFile & "!" & strMacro


xwkb.Close False
Set xwkb = Nothing
xls.Quit
Set xls = Nothing
End Sub
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top