Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to export hotfile -- doesn't work with specified path 1

Status
Not open for further replies.

marksg

Programmer
Jun 12, 2000
15
0
0
US
I've written a macro to export a hotfile to a specified path, however the export doesn't produce anything anywhere. However, if I leave off the path and leave just the name, the hotfile is produced in the winnt\system32 directory. See the code below. If anyone has any advise please let me know. Thanks!!!

Option Explicit

Dim objImpApp as object
Dim objImpRep as object

Sub Main()

on error goto ErrHandler

Set objImpApp = createobject("CognosImpromptu.Application")

objImpApp.OpenCatalog "e:\reporting\ccs catalog\gap and intv diag - qa.cat", "creator"

objImpApp.Visible True

Set objImpRep = objImpApp.OpenReport("e:\reporting\gaps and interventions\imrs\g&ibydxpt1-ccreports.imr")

objImpRep.RetrieveAll

objImpRep.ExportHotFile "e:\reporting\hotfiles\testscript.ims"

objImpRep.ExportHotFile "testscript.ims"

objImpRep.CloseReport

objImpApp.Quit

set objImpRep = Nothing
set objImpApp = Nothing

msgbox "completed"

Exit Sub

ErrHandler:
msgbox "ERROR: " & Err & ": " & Error$

End Sub
 
Put a dummy file in the destination directory and check for its existence using the Dir() function. Bounce an error message if it cannot be found. The code looks fine. These problems are usually caused by a typo or error in the destination directory path.

HTH,

Dave Griffin
The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
 
Thanks Dave that's exactly what it was, corrected the directory error and it worked fine!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top