• WSSammyB

    WSSammyB

    @wssammyb

    Viewing 15 replies - 31 through 45 (of 1,741 total)
    Author
    Replies
    • in reply to: control down arrow (2003) #1086910

      Duh… Thanks much!!!

    • in reply to: FileSearch Directory Wildcards (VBA) #1086567

      Thanks, Hans. That’s even easier than I remember. –Sam

    • in reply to: FileSearch Directory Wildcards (VBA) #1086562

      yep, that’s exactly what’s needed. Initially, I thought why bother with Dir, I’ll just use Application.FileSearch
      Bad idea, I forgot that I have over a million files, 1400 folders and half a terabyte of tiffs. Not a good environment for FileSearch drop
      I was thinking I would have to construct a sheet with a lookup table, but Alan’s scheme works a treat and and seems fast enough. Thanks for the effort: I hadn’t realized that you need to check the attributes. It’s annoying that the dir(… vbDirectory) includes directories rather than excluding all but directories. Anyway, thanks again! –Sam

      PS hijacking the thread. Can you find a link to the ShellAndWait api? I need to process the dozen or so tiffs that I found, wait, and then process the next set. The program that processes the tiffs must have a memory leak because the time to process a tiff increases a minute for every 13 tiffs, so I have to split up my efforts.

    • in reply to: FileSearch Directory Wildcards (VBA) #1086421

      That is very cool, but it took forever (5-10 minutes) on a small test system with XL whining about having to wait for another OLE process. Being a glutton for punishment, I ran it again and it only took 20 seconds, However, I ran it again several hours later and it took 6 minutes. This will be running on a terabyte disk server, so even the 20 seconds is not acceptable, I can just manually traverse the directory tree. I haven’t tried using the Windows API directly yet, probably should do that, but it ‘s a pain. Thanks! –Sam

    • in reply to: Keys Again (VB.NET 2005) #1067101

      Thanks, Mark for the confirmation! I was just trying to help a friend. It turned out even worse: he had developed a class using that keyed collection as a base class and then wanted to sort it by keys. You wonder why they didn’t seal all of the VB library. Like you, I told him to rewrite it using generics. Thanks again.

      But, I’m still intrigued by how Quick Watch can see the keys and that each entry in the collection is a key value pair. Have you ever used System.Reflection? Could this be of use here?

    • in reply to: Get the Keys From a Generic Sorted List (C# 2005) #1064417

      >the problem here is the CopyTo function
      Right, it will take a different approach. The real problem is that IList does not have a ToArray method. I tried casting it into something else, but failed.

      > you could always remove the line breaks disappointed

      > you have been a VB(.NET) guy
      At this point, I’ve forgotten more than I know about VB. For about a year, I’ve been creating tools for a Geographic Information System, ArcMap, using C#. Its object model is so horrific http://edndoc.esri.com/arcobjects/8.3/Diagrams/Map Layer Object Model.pdf[/url], that I’ll never complain about Office objects again.

      Eureka!

                  string[] keys = new List(sList.Keys).ToArray(); 
    • in reply to: Get the Keys From a Generic Sorted List (C# 2005) #1064387

      I’m in the process of converting a zillion lines of code from framework 1.1 to framework 2.0. As we convert to generics we are entering code like this a lot, so a one-liner would mean less time to convert. Plus, it’s just a simple copy: should be one line.

      BTW, there was a typo in the code: here is a working example:

              private void button1_Click(object sender, EventArgs e)
              {
                  SortedList sList = new SortedList();
                  sList.Add("A", "1");
                  sList.Add("B", "2");
                  sList.Add("C", "3");
                  // 
                  // Should be a one-liner for the next three lines
                  IList keyList = sList.Keys;
                  string[] keys = new string[keyList.Count];
                  keyList.CopyTo(keys, 0);
              }
    • in reply to: Net Training (2005) #1061367

      chemicals in the brain becoming depleted drop

    • in reply to: Select Crop Tool with VBA (XL 2000) #1060388

      I have to manually crop each image, so it is one less mouse-click if I preselect the crop tool. Just tried .Execute & it works:

          Application.CommandBars("Picture").FindControl(ID:=732).Execute

      Thanks anyway! I was just feeling lazy today (320 images to crop).

    • in reply to: Select Crop Tool with VBA (XL 2000) #1060371

      What! drop

    • in reply to: Select Crop Tool with VBA (XL 2000) #1060364

      Just want to select the tool

    • in reply to: VBA Max of a column (2000) #1060089

      iMax = Application.Max(Column(1))
      It dosn’t work for me! drop

    • in reply to: VBA Max of a column (2000) #1059543

      stupidme newbrain

    • in reply to: formula help (excel2003) #1059531

      Formula for D2 is

      =IF(YEAR(C2)=2007,IF(A2 & B2=Sheet2!A2 & Sheet2!B2,"planned","not planned"),"")
    • in reply to: VBA Max of a column (2000) #1059528

      Bizzare! That works! Thanks! I’d like to see an expalnation of why.

      BTW, I resorted to some really weird code instead:
      iMax = [Max(Sheet1!C:C]

      I don’t do that very often because there is a lot of overhead; ie, don’t do it in a loop. But, for initializing your variables, it’s quick & dirty. Dirty, because if you move column C, your code no longer works.

    Viewing 15 replies - 31 through 45 (of 1,741 total)