Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Save Dialog box macro code getting an error when saving in desktop

Hi,

I am tried a Macro Code for "Save Dialog Box", and using the below macro code.

But when i creating save folder path in Desktop it is generating an error. Now i wanted to remove that error and allow the user to save in Desktop also.

How can i do it and what modification should i done in the below macro.

Any one help on this.

Function SaveXML()

    set vDataSet = ActiveDocument.Variables("vDataSet")    

    set vBMname = ActiveDocument.Variables("vBookVar")

    Dim objShell

    Dim ssfWINDOWS

    Dim objFolder

    Set objShell = CreateObject("Shell.Application")

    Set objFolder = objShell.BrowseForFolder(0, "Example Select Folder", 0, strRootPath)

    If (Not objFolder Is Nothing) Then

        If objFolder.Title = "Desktop" Then

            MSGBOX "Out Put File Can't Create in Desktop! Sorry for the inconvenience"

            ELSE

            ''IF objFolder.ParentFolder.ParseName(objFolder.Title).Path = " " THEN

            ''MSGBOX "null"

            ''END IF

             ActiveDocument.ExportBookmarks ""&objFolder.ParentFolder.ParseName(objFolder.Title).Path & "\" &vDataSet.GetContent.String&"_"&vBMname.GetContent.String&""&replace(Date(),"/","")&"_"&replace(Time(),":","")&".BM.xml"   

            MSGBOX("File Has Been Saved Successfully.,")

            End If

    End If

    Set objFolder = Nothing

    Set objShell = Nothing

'ActiveDocument.Save

End Function

Thanks in advance

0 Replies