L
Legacy 15162
Guest
what reference library do i need to use docmd.setwarning true? or to run a dos command from excel vba?
Dim retval
retval = Shell("pdfMachineCmdLine \\test-sql\test.xls \\test-sql\test.pdf")
Yes.I am getting a runtime error 53 "file not found" do i need to tell it where pdfmachinecmdline.exe is located?
Set xlOrigWB = ActiveWorkbook
For I = 1 To xlOrigWB.Worksheets.Count
Set xlCopyWB = xlOrigWB
Set xlWS = xlCopyWB.Worksheets(I)
stWkshtName = xlWS.Name
Select Case stWkshtName
Case "APC", "LA-TX", "Carolinas", "Cen LA", "South LA", "West Laf", _
"Midland", "Odessa", "N Charlotte", "SW Charlotte", "E Charlotte", _
"W Charlotte", "C Charlotte", "CONTROL", "Administrative"
' do nothing
Case Else
xlWS.Copy
' lngPeriod = Right(xlWS.Cells("C1"), 2)
Set xlCopyWB = ActiveWorkbook
NewFileName = "\\test-sql\Poll\StoreUpld\" & stWkshtName & "pnlp" & stPeriod
xlCopyWB.SaveAs (NewFileName)
'xlWS.Cells.Copy
'xlWS.Cells.Select
'xlWS.Cells.PasteSpecial (xlPasteValues)
xlCopyWB.Close
retval = Shell("pdfMachineCmdLine " & NewFileName & ".xls " & NewFileName & ".pdf")
End Select
Next I