all groups > sql server dts > october 2003 >
You're in the

sql server dts

group:

Debug Pop Up Window in DTS



Debug Pop Up Window in DTS BJ
10/31/2003 12:29:28 PM
sql server dts: Is there a way to turn debugging off in an ActiveX script?
I get an error when I run this job. I want to run it as a
job and it hangs. I want it to fail and report an error.

It runs ok sometimes.
If fails when it tries to run the macro: A debug window
appears. Can I turn that off in the code?

thanks

'**********************************************************
************
' Visual Basic ActiveX Script
'**********************************************************
**************

Function Main()
Dim xlApp,strFile



ON ERROR RESUME NEXT
strFile
= "E:\ExCelExports\DCA\BWDCAR\Timesheets\Test\BWDCAR_D5005
3.xls"

Set xlApp = CreateObject("Excel.Application")


xlApp.Workbooks.Open "E:\ExCelExports\DCA\BWDCAR\Macros\ma
cro.xls"

xlApp.Workbooks.Open strFile


xlApp.Run ("MACRO.xls!Module1.MACRO1")

xlApp.ActiveWorkbook.Save

xlApp.ActiveWorkbook.Close True
xlApp.Quit

Set xlApp = Nothing

IF Err.Number <> 0 then

xlApp.ActiveWorkbook.Save

xlApp.ActiveWorkbook.Close True
xlApp.Quit

Set xlApp = Nothing
Main = DTSTaskExecResult_Failure
End If

Main = DTSTaskExecResult_Success
End Function
Re: Debug Pop Up Window in DTS BJ
10/31/2003 1:48:59 PM
No. not sure what all it will affect.

Thanks
Bj
[quoted text, click to view]
Re: Debug Pop Up Window in DTS BJ
10/31/2003 2:06:25 PM
When I run it inside the DTS Designer.
When I run as as scheduled job it just hangs.
In the designer it is given me a choice end or debug.
I figure it hanging on that error when i run the job.

thanks

[quoted text, click to view]
Re: Debug Pop Up Window in DTS BJ
10/31/2003 2:28:45 PM
It bombs at .LeftHeader = ""
and if i remove that it bombs at the next one.

Thanks
I leaving work now but will get online when I get home.
I appreciate you attention to this.

Check you in about an Hour. Happy Halloween!!!

BJ

With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1

Range("E1").Select
Selection.Cut
Range("U1").Select
ActiveSheet.Paste
Range("R1").Select
Columns("U:U").EntireColumn.AutoFit
Range("R1").Select
ActiveCell.FormulaR1C1 = "File Creation Date:"
Range("R1").Select
Selection.Font.Bold = True
Range("A1:B1").Select
Selection.Cut
Range("B1").Select
ActiveSheet.Paste
Columns("A:A").Select
Selection.EntireColumn.Hidden = True
Columns("E:J").Select
Selection.EntireColumn.Hidden = False
Range("H6").Select
ActiveWindow.SmallScroll ToRight:=17
ActiveWindow.ScrollColumn = 10
Columns("C:E").Select
Selection.EntireColumn.Hidden = True
Columns("B:F").Select
Selection.EntireColumn.Hidden = False
Columns("E:I").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=1
ActiveWindow.ScrollColumn = 10
ActiveWindow.SmallScroll ToRight:=6
ActiveWindow.ScrollColumn = 10
ActiveWindow.SmallScroll ToRight:=18
ActiveWindow.ScrollColumn = 10

Columns("D:J").Select
Selection.EntireColumn.Hidden = False
Range("G4").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=6
Range("U1").Select
ActiveSheet.Paste
Selection.Font.Bold = True
ActiveWindow.SmallScroll ToRight:=-1
Range("R1").Select
ActiveCell.FormulaR1C1 = "File Creation Date:"
Range("R1").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "Location Number:"
Range("E4").Select
Range(Selection, Selection.End(xlUp)).Select
Range("E4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Columns("E:I").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.ScrollColumn = 10
Sheets.Add
Range("A2").Select
ActiveCell.FormulaR1C1 = "SSN"
Range("B2").Select
ActiveCell.FormulaR1C1 = "First Name"
Range("C2").Select
ActiveCell.FormulaR1C1 = "Last Name"
Range("D2").Select
ActiveCell.FormulaR1C1 = "Regular Hours"
Range("E2").Select
ActiveCell.FormulaR1C1 = "OT Hours"
Range("F2").Select
ActiveCell.FormulaR1C1 = "Vacation Hours"
Range("G2").Select
ActiveCell.FormulaR1C1 = "Sick Hours"
Range("H2").Select
ActiveCell.FormulaR1C1 = "Holiday Hours"
Range("I2").Select
ActiveCell.FormulaR1C1 = "Hygenist Regular Days"
Range("J2").Select
ActiveCell.FormulaR1C1 = "Hygenist Sick Days"
Range("K2").Select
ActiveCell.FormulaR1C1 = "Hygenist Vacation Days"
Range("L2").Select
ActiveCell.FormulaR1C1 = "Hygenist Holiday Days"
Range("M2").Select
ActiveCell.FormulaR1C1 = "Bonus Dollars"
Range("N2").Select
ActiveCell.FormulaR1C1 = "Auto Allowance"
Range("O2").Select
ActiveCell.FormulaR1C1 = "Other Earnings"
Range("P2").Select
ActiveCell.FormulaR1C1 = "Retro Dollars"
Range("Q2").Select
ActiveCell.FormulaR1C1 = "Retro Hours"
Range("R2").Select
ActiveCell.FormulaR1C1 = "Uniform Dollars"
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
[quoted text, click to view]
Re: Debug Pop Up Window in DTS anonymous NO[at]SPAM discussions.microsoft.com
10/31/2003 4:31:32 PM
It works for me when I run the DTS from my loacl machine in
the designer or if I run the Macro from the folder.

When I 'm on the server where I would like to run it from
it fails intermittently in the designer and from the folder.

My original question was is there a way to bypass that
prompt end , debug that pops up in the designer. If so I
can retry run it in a job until it works!

OH someone else wrote the macro. They moved on, I moved in
I'm migrating the process from Access to SQL. This is just
a sample of what I will have mulitple exports loaded.
Thanks
BJ
[quoted text, click to view]
Re: Debug Pop Up Window in DTS Allan Mitchell
10/31/2003 9:16:16 PM
Have you enabled JIT?

Right click on the DTS folder in EM | Properties

--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org




[quoted text, click to view]

Re: Debug Pop Up Window in DTS Allan Mitchell
10/31/2003 9:56:06 PM
At what point does the window appear?
Forget DTS, if you copy | paste this code elsewhere does it still popup?


--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org




[quoted text, click to view]

Re: Debug Pop Up Window in DTS Allan Mitchell
10/31/2003 10:18:00 PM
Correct. We need to fix the error/Stop the debug window coming up. Excel
is notorious for this. Can you offer more on where it bombs.? There is a
"TEST" button in the designer for Active Script task.

--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org




[quoted text, click to view]

Re: Debug Pop Up Window in DTS Allan Mitchell
10/31/2003 10:49:18 PM
Ahhhhhhhhhhhhh so the problem is not in the invoking of the Macro rather the
Macro itself.

How did you create it ?

I pasted it into Excel macro - Removed the printer stuff - added an extra
End With and it works for me

--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org




[quoted text, click to view]
Re: Debug Pop Up Window in DTS BJ
11/1/2003 7:00:28 AM
Thanks again .
It works fine if I run the reports against files on my
local machine using UNC naming. I can propably find a
shared folder on the network to run them.

Do you know what would cause this macro not to run properly
on the server. It runs OK on my local and in a shared
folder on the network.

I've checked the version of Excel and it is the same. I
use terminal service to open a connection to the server I'm
trying to run it on. That should not affect how it runs in
a job. I do plan to go to the terminal and log in to the
server and see what happens.
Any thoughts?


Thanks again.

BJ

[quoted text, click to view]
Re: Debug Pop Up Window in DTS anonymous NO[at]SPAM discussions.microsoft.com
11/1/2003 8:52:52 AM
Thanks
Bj
[quoted text, click to view]
Re: Debug Pop Up Window in DTS Allan Mitchell
11/1/2003 12:28:12 PM
I would look to fix the popup. Reason: Office is one of those products MS
do not support in an unattended server side scenario. And it is probably
because of reasons like this. Other people I know have a job running
afterwards that kills Excel.exe

Sorry.



--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org




[quoted text, click to view]
Re: Debug Pop Up Window in DTS Allan Mitchell
11/1/2003 3:19:01 PM
If the server can see the file(s) and the accounts (Agent etc) can see the
files, the versions of Excel are the same, you are allowed to run macros,
you have a printer set up then I do not quite know what might be causing it
to fail. I would try breaking it down though and then adding pieces back
bit by bit. You can then maybe beter idetify exactly the combination of
conditions that cause it go west.

--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org




[quoted text, click to view]
Re: Debug Pop Up Window in DTS BJ
11/1/2003 4:05:40 PM
I don't believe there is a printer configured on the server.
Could that be the problem?

BJ
[quoted text, click to view]
Re: Debug Pop Up Window in DTS Allan Mitchell
11/2/2003 2:09:49 PM
From what i saw in the Macro you are trying to Print I think ?

--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

[quoted text, click to view]
Re: Debug Pop Up Window in DTS BJ
11/4/2003 7:42:21 AM
Hi
After adding a printer to my terminal session, the DTS
package ran great on the server in the designer. However
the job still fails unless it sees printers from the
administrator account. I belive I have to add a printer
for the sqlagent account in order for it to work as a job.

You have guided me in the right direction.

Thanks

BJ
[quoted text, click to view]