Jump to content

@desktopdir


Recommended Posts

Dear all, I have a script with which I am writing data to 2 excel files simultaneously.In that script I am using @scriptdir command.While using this cmd, I have 2 excel files and script in one folder and @scriptdir command worked fine.But now I am going to change excels to two different folders. One onto my desktop and other to subfolder in desktop.For this I am replacing @scriptdir with @desktopdir but it is not working.Moreover, while writing to data in excel in desktop, it is overwriting and it is visible.Please help me out in this reg.Thanks and Regards

Thanks

Link to comment
Share on other sites

Without any example code we can only guess what you're doing wrong, but keep in mind that @desktopdir returns the path to the desktop without a trailing "\".

To write to a folder on the desktop you need to use this syntax:

@desktopdir & "\foldername\filename.xls" not @desktopdir & "foldername\filename.xls

To add data to the excel file instead of overwriting you can either get the last row that has data in excel and start writing from there, or read the excelfile, then add your data to that and write the entire thing back (technically still overwriting)

_ExcelBookOpen() has a "visible" parameter you can set to 0 to run excel hidden.

If this doesn't help, then post some example code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...