Posts by Susy

    Hi there,


    how can i catch this error before it happens, i.e., when OpenDatabase(DBFullName) is nothing... but I have tried with If is nothing... or if len()<= 0 then .... it doesn't work



    Code:

    Code
    Dim db as dao.DatabaseDim DBFullName as StringDBFullName = wkmain.(Cells(30,3).Value ' ---> let's assume that the database in this path cannot be found, then what? --> I would like to check before "Set db = Opendatabase()" if is not empty.Set db = OpenDatabase(DBFullName)


    Do you have any ideas how to check before running into error 3024?


    Thanks in advance!

    Hi there,


    would anyone out there be so kind to explain me what the "Case 2, 4, 6, 34" means?


    I found this code on the internet and I am trying to do something similar... but I would like to know what I am doing :)



    Please let me know!

    hi everyone,


    I believe this has been done already... unfortunately I cannot find it! ;)


    I need to get data from one Worksheets("Data") which is saved in various workbooks (sometimes more than 50 workbooks in one folder).


    Instead of opening each workbook and going to the SheetName where the data is saved, I would like to create a macro which:
    1. get the data from this SheetName from all Workbooks without "opening" all the workbooks.
    1.1 from Main Workbook (where macro is saved) I need to open the workbooks
    1.2 once the workbook is open, get the data in WorksheetName.Cells(X,X).Copy
    1.3 Close the workbook (external workbook) and go back to Main Workbook.
    1.4 in Main Workbook in SheetDataCollection saved the data from workbooks row wise.


    2. Do the same above for the next Workbook in the specified folder...
    2.1 Do this until the last file (Workbook).


    Can anyone help me with these?


    Cheers!

    Re: vba filename search for &quot;.&quot; within the name for csv


    Hi Trebor76,


    I was not able to use your code 1 to 1, but your approach helped me solve my problem...


    From your code I used the GetExtensionName Method and

    Code
    InStr(strMyFile, ".") > 0 ThenExit Sub

    code.



    Thanks for your time and insight!


    Greetings!

    Hi there,


    I need some help... I am trying to get the filename of a file, in some folder, which contains "." (periods) in its name.


    All the files are "csv".


    For example: myfile.03.01.2017.csv


    --> Filename: myfile.03.01.2017


    So, once I get the filename as above, I need to find out if the filename has a "." (period).


    It it has a "." then exit sub, otherwise continue with the sub procedure...


    Unfortunately, I have no idea how to do this.


    Any idea?


    Cheers

    Re: vba excel combobox loading values from query ms access


    This is the final version... I tested it and it works.... it was really simple... Enjoy!
    :0ops:


    However, this is ADO and DAO together!!!
    http://www.fontstuff.com/vba/vbatut10.htm


    Code
    With ComboBox1
              Do
                  .AddItem rs![First_Name]
                  rs.MoveNext
              Loop Until rs.EOF        
          End With






    :)

    Re: vba excel combobox loading values from query ms access


    It seemed good, almost too good. :hammerhe:


    Unfortunately, the code has a big bug!!!!



    These lines

    Code
    For i = 0 To UBound(FData)
                        .List(.ListCount - 1, i) = rs.Fields(i)
                    Next
                    End With
                    rs.MoveNext
                Loop


    are forgetting the one value from this line....


    Code
    ComboBox2.Value = FData(0, 0)



    So at the end, if there are more than one recordset, then I get all of them minus 1 (n-1)... which is not good at all!!!!


    If anyone has an idea how to fix this, I will be really thankful!


    Thanks again.

    Re: vba excel combobox loading values from query ms access


    Finally........ it is not pretty but it works, for now :music:


    Thank you all!