Error Creating Directory and Saving Excel Workbook on Vista

kmmm2008

New member
Joined
Mar 2, 2008
Messages
3
Programming Experience
5-10
I have a VB.net applications that runs on XP and creates a directory and creates an Excell workbook and saves it. But when I do the same in Vista , when it tries to create a directory to save the excel workbook, it gives me an error that the directory does not exist. If I create the directory manually, it still gives me the same error. Is there a COM call for office 2007 on Vista other than worksheet.SaveAs(FileName:=path). All else works on Vista apart from creating a directory and Saving Excell Worksheet.
VB.NET:
Public Function createDirectory(ByVal path As String) As String
        Dim new_path As String
        Try
            If Directory.Exists(path) Then
                Directory.GetDirectories(path)
                new_path = path
            Else
                Directory.CreateDirectory(path)
                new_path = path
            End If
        Catch ex As System.IO.DirectoryNotFoundException
            Throw ex
        Catch ex As Exception
            Throw ex
        End Try
        Return new_path
    End Function
I am frustrated so much. Please help!!!!!!!!!!!!!
 
Found the issue with Vista

The reason that this happens is because of what we call User Control under manage users on Vista . If this is on, then it requires a prompt for the user to continue. When an application is running, this pop up prompt does not pop up and you cannot know why it does not execute the SaveAS command for Excel . What I did was to go to Control Panel -> Users- and turn off User Control and that fixed my problem. I see nobody has experienced this as nobody replied but I was able to play with it some and all is working fine.
 
Hi,

I have turned off UAC but I still cannot save excel file from my vb.net code. Any other suggestions???

Thanks,
Aebeer
 
Back
Top