Date: Tue, 12 Aug 2008 12:36:05 -0400
Reply-To: "Chambers, Charles (CDC/CCEHIP/NCEH) (CTR)" <ayo6@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Chambers, Charles (CDC/CCEHIP/NCEH) (CTR)" <ayo6@CDC.GOV>
Subject: Re: SAS and VBA
In-Reply-To: <200808121551.m7CAkiSG022000@malibu.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii
I run this code from an Access Form module:
Private Sub oldQCReport()
On Error GoTo Err_oldQCReport
Dim fs As Object
Dim Path As String
Dim Path2 As String
Dim test As String 'test code
'DoCmd.SetWarnings False
Path = "Q:\Pesticides\Final Reports\" & Trim(StudyTracker) & " " &
Trim(StudyName)
Set fs = CreateObject("Scripting.FilesystemObject")
If fs.FolderExists(Path) = False Then fs.CreateFolder (Path)
Path = Path & "\" & MethodName
If fs.FolderExists(Path) = False Then fs.CreateFolder (Path)
Path2 = Path & "\" & MatrixName & "_QC_Results"
Path = Path & "\" & MatrixName & "_QC_Data"
Set fs = Nothing
Dim OleSAS As Object
Set OleSAS = CreateObject("SAS.Application")
OleSAS.Visible = True
OleSAS.Height = 1024
OleSAS.Width = 1200
OleSAS.X = 0
OleSAS.Y = 0
OleSAS.Top
OleSAS.Submit ("%let PDF_Location = " & Path2 & " ;")
OleSAS.Submit ("%let QC_Location = " & Path & " ;")
OleSAS.Command ("Include 'Q:\Pesticides\QC data\New QC
Procedure.sas';")
OleSAS.Submit ("%Inc 'Q:\Pesticides\QC data\New QC Procedure.sas';
")
Me.cmdClose.SetFocus
Me.cmdQCReport.Enabled = False
Set OleSAS = Nothing
'DoCmd.SetWarnings True
Exit_oldQCReport:
Exit Sub
Err_oldQCReport:
If Err.Number = 58 Then
Resume Next
Else
MsgBox Err.Description, Err.Number
Resume Exit_oldQCReport
End If
End Sub
Charles Chambers
Database Manager
Emergint Technologies Inc
CDC/NCEH/DLS/OAT
Contemporary Pesticides Laboratory
4770 Buford Hwy, M/S F-17
Atlanta, GA 30341
Work 770-488-4170
Cell 404-271-6421
cchambers@cdc.gov
http://www.cdc.gov/nceh/dls/default.htm
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Mona
Sent: Tuesday, August 12, 2008 11:51 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: SAS and VBA
Hi All,
I am just curious if anyone has used VBA with Base SAS to build
applications.
Any insights on using VBA with SAS(minus DDE) would be really
appreciated.
Thanks,
M