
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VB Script Issue in creating WScript.Shell Object
Hi,
i have downloaded a document regarding creating a PDF Report, In That there is Macro function which have below
Function printReportPDF(pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
End function
Same i had copied the macro in my QV file as below
Function printReportPDF_NEW(pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
End function
But the downloaded document working fine , but in my document red marked line giving me error.
"ActiveX component can't create object: 'WScript.Shell' "
Kindly let me know why i am getting error in 1 document and not in other document.
- Tags:
- vbscript
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is usually due to the Module permissions. Open the Module Editor (Ctrl-m) and select "Allow System Access" in the Current Local Security dropdown.
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check have you install free pdf printer and sample demo
Hope this helps you
Vikas
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i had check the same code which u have attached , your code is not giving error while running, same code i copied from your document to my document and its showing me the error on this line
Set WSHShell = CreateObject("WScript.Shell")
Error : "ActiveX component can't create object: 'WScript.Shell' "


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is usually due to the Module permissions. Open the Module Editor (Ctrl-m) and select "Allow System Access" in the Current Local Security dropdown.
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Rob,
Its Working Now 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vikas,
For your example which PDF Creator Application u have used ?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rob, I have a question
every time I run the macro I get a pop up where it tells me where I should store the file, there is some way to run the default route without having to pop up


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
rwunderlich please your support


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you post the macro you are running?
-Rob


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is macro

- « Previous Replies
-
- 1
- 2
- Next Replies »