Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1131
  • Last Modified:

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
0
Larry Biederman
Asked:
Larry Biederman
  • 4
2 Solutions
 
Rey Obrero (Capricorn1)Commented:
try this setting
Office Button > access options > trust center > trust center settings > macro settings > enable all macros
0
 
Larry BiedermanSoftware EngineerAuthor Commented:
I did set enable all macros.  Also added Q:\ drive as trusted area.
Doesn't work.

Thanks for input!!
0
 
Larry BiedermanSoftware EngineerAuthor Commented:
If I "OutputTO" a blank report first, it works!
Strange.
0
 
Larry BiedermanSoftware EngineerAuthor Commented:
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
0
 
Larry BiedermanSoftware EngineerAuthor Commented:
Other solution didn't work.  Somehow OutputTO a report that's blank first worked.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now