none
VBA statement "Kill" not recognized

    일반 토론

  • Hi,
    I needed to write a VBA macro to be most compatible (would be used not only in MS Office), thus avoiding Scripting.FileSystemObject etc. Used Excel 2010 as a sandbox.

    Found out that VBA editor kind of doesn't recognize some legacy statements such as Kill pathname, Dir[(pathname[, attributes])] leaving them black. Some others such as Name oldpathname As newpathname get are correctly turned blue.

    Not big issue, but thanks for any comments/explanations.

    MP

    2012년 6월 8일 금요일 오전 7:23

모든 응답

  • It may not format Kill or Dir as keywords, but they should still work correctly. I use Dir all the time without any problems.

    Regards, Hans Vogelaar

    2012년 6월 8일 금요일 오전 9:13
  • Yes Hans, these DO work (I'd complain if they didn't). I was just curious if the formating ever worked for anyone else.

    Thanks and greetings from CZ to the Nederland.

    MP


    2012년 6월 8일 금요일 오전 10:03
  • The formatting doesn't work for me either.

    Greetings back to the Česká republika!


    Regards, Hans Vogelaar

    2012년 6월 8일 금요일 오전 10:22
  • Thanks. I just hope these legacy statements from times when programmes HAD some sense of black humor (Kill pathname) are not going to be deprecated

    MP

    2012년 6월 11일 월요일 오전 11:23
  • VBA does recognize the Kill statement. Look up "kill statement" in the VBA help and it comes up with a help topic. Additionally if I try kill( in a sub I get intellisense for it. Same thing with Dir.

    I tried this in Excel 2010 VBA. What Office program and version are you using to write this?

    Will Buffington
    Microsoft Excel Support

    2012년 6월 12일 화요일 오후 10:46
    중재자
  • Hi,
    I meant VBA editor doesn't recognize kill = doesn't display it in blue color like other keywoards. Excel 2010

    MP

    2012년 6월 12일 화요일 오후 11:20