Link to home
Start Free TrialLog in
Avatar of Larry Biederman
Larry BiedermanFlag for United States of America

asked on

Access 2007 error 2950, even in trusted area

I call an Access 2007 macro with a shell command from VB6.
The macro runs fine until end when it calls a vba code module, and produces error 2950 ( 2950 is supposed to be because DB is in untrusted path).

I went into Access, and added this server folder as trusted location.

The code module that results in error 2950 is:

Function WorkPeriodHoursReport()
Dim i As Integer
On Error Resume Next
Kill "C:\RWH2\" & "MyReport" & ".pdf"
  DoCmd.OutputTo acOutputReport, "WorkPeriodHoursReport", acFormatPDF, "C:\RWH2\" & "MyReport" & ".pdf", False

'Method 1
Application.FollowHyperlink ("C:\RWH2\MyReport.pdf")

'or Method 2
Dim MyShell As Variant
'MyShell = Shell("C:\RWH2\printPDF.bat", vbMinimizedNoFocus)
End Function

Funny thing is that it worked in past!

Need fix fast for client - 500 points!
Any fix appreciated!

-Larry
SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Larry Biederman

ASKER

I did set enable all macros.  Also added Q:\ drive as trusted area.
Doesn't work.

Thanks for input!!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I gave the expert 100 points for a single reply.
Although didn't fix, I ap[preciated efforts.

If moderator wants to give him all 500 points, ok.
Whatever is fair.

lbiederman
Other solution didn't work.  Somehow OutputTO a report that's blank first worked.