Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. rmikesmith

    Test for already Opened Excel Spreadsheet Fails

    Diane, In the VB Editor, press F2 to display the Object Browser (or View|Object Browser). Select the object (left pane) then a property, method or event (right pane) then right-click and Help for help on that item. Regards, Mike
  2. rmikesmith

    Test for already Opened Excel Spreadsheet Fails

    Diane, Try Set wkbTarget = XLApp.Workbooks.Open(Filename:=sPATH & sFILE, UpdateLinks:=True) or set UpdateLinks to False, as the case may be. Regards, Mike
  3. rmikesmith

    Test for already Opened Excel Spreadsheet Fails

    I added these for my testing only since I didn't have access to your environment. I had to assume your code was assigning values elsewhere, hence my instruction to remove my assignments in the procedure. I'm not exactly sure what you mean by this question. The path is not used to detect an...
  4. rmikesmith

    Use code to list Module names in worksheet

    I suppose *easy* is in the eye of the beholder, but Chip Pearson, MS Excel MVP, has a very good explanation + working code to manipulate objects in the VBE, including a specific example to list all modules in a VBProject. Here is a link to the page: http://www.cpearson.com/excel/vbe.aspx...
  5. rmikesmith

    Test for already Opened Excel Spreadsheet Fails

    DianeA, Just add an On Error Resume Next statement before the GetObject line. I only tested my code with Excel already running, so missed it. If you are using other error trapping be sure to reinstate this after the GetObject/CreateObject section. Regards, Mike
  6. rmikesmith

    Sort and ADO recordset in Excel using the SORT property

    No, when you set a reference to an external library (ADO in this case), you have access to all of its properties/methods. An ADO reference I use indicates the following: Note: This property (Sort) can only be used if the CursorLocation property is set to adUseClient. Is that the case in your...
  7. rmikesmith

    Test for already Opened Excel Spreadsheet Fails

    Diane, I think you were on the right track but didn't go quite far enough. The main issue with your IsOpen function is that no actual reference to an instance of Excel is set. I was able to duplicate that execution skips the entire loop. I have rewritten your procedure to streamline things...
  8. rmikesmith

    [b]Saving multiple worksheets as delimited files[b/]

    Or Sub SaveSheetsToFile() Dim ws As Worksheet Dim MName As String Dim MDir As String For Each ws In ActiveWorkbook.Worksheets MName = ws.Name & ".txt" MDir = ActiveWorkbook.Path ws.Select ActiveWorkbook.SaveAs Filename:=MDir & "\" & MName, FileFormat:= _ xlText...
  9. rmikesmith

    [b]Saving multiple worksheets as delimited files[b/]

    Is the worksheet name a valid filename? Are there write-access restrictions on the destination drive/folder? Regards, Mike
  10. rmikesmith

    Installing object libraries from later versions of office

    bodmin, Any feedback on HughLerwill's suggestion, which should do what you want? Ah, the cruelty. Regards, Mike
  11. rmikesmith

    [b]Saving multiple worksheets as delimited files[b/]

    Try single-stepping through your code to if this error is occurring first time through the loop or otherwise. Or, select Debug when the error occurs and determine which worksheet is being referenced. Either way, inspect your variable values to make sure they are valid. I just ran a modified...
  12. rmikesmith

    [b]Saving multiple worksheets as delimited files[b/]

    Try this instead: Private Sub CommandButton2_Click() Dim ws As Worksheet ThisWorkbook.Save For Each ws In ActiveWorkbook.Worksheets MName = ws.Name & ".txt" MDir = ActiveWorkbook.Path ws.SaveAs Filename:=MDir & "\" & MName, FileFormat:= _ xlText, CreateBackup:=False Next ws...
  13. rmikesmith

    Installing object libraries from later versions of office

    I don't believe those object libraries are redistributable so at the very least, there would be legal issues, if not technical ones. So, yes, I think your only options are upgrading or selecting a different approach. If you explain what your macro currently does, someone can probably point to...
  14. rmikesmith

    Convert XL Column Number

    tranpkp, Skip & Geoff raise a valid point. However, I present the following corrected function if for no other reason than I felt compelled to make it work: Function ColumnNumToAlpha(ByVal ColNum As Integer) As String Dim sTmp As String Dim iDiv As Integer Dim iMod As Integer If ColNum <...
  15. rmikesmith

    Convert XL Column Number

    PHV, Nice one. I'll tuck that away for future reference. tranpkp, Here is a function that doesn't use Excel's object model but does require integer division (\), modulus (mod) and the Chr() funciton: Function ColumnNumToAlpha(ByVal ColNum As Integer) As String Dim iDiv As Integer Dim iMod...
  16. rmikesmith

    Convert XL Column Number

    tranpkp, Try the following function: Function ColumnNumToAlpha(ByVal ColNum As Integer) As String Dim CellAddress As String Dim Pos1 As Integer Dim Pos2 As Integer CellAddress = Cells(1, ColNum).Address Pos1 = InStr(1, CellAddress, "$", vbTextCompare) Pos2 = InStr(Pos1 + 1...
  17. rmikesmith

    Excel VBA show custom FaceID

    xlStar, Yes, you can. Follow these steps (I'm using Excel 2000 so the menu commands / dialogs might be somewhat different): 1. Edit your button image in the editor 2. From the Customize dialog select 'Modify Selection' then 'Copy Button Image' from the popup menu. 3. Close the Customize...
  18. rmikesmith

    Really Strange 1004 Application-Defined Error!

    As Combo indicated, you're row/column references appear to be reversed. In any case, Excel 2003 (and earlier) has a limit of 256 columns, so if you are allowing y to increment to 1500 you're going to throw an error. Regards, Mike
  19. rmikesmith

    Syntax for creating an object

    Bill, Try adding the following line of code: Dim cust As Customer Dim strConn As String strConn = "ApplicationName= """ & "my app" & """ CompanyFile= """ & "QB path and file name" & """" Set cust = New Customer cust.QBConnectionMode = cmDontCare cust.QBConnectionString =...
  20. rmikesmith

    Macro to delete files from an Excel list

    Rich, Something like the following should work: Sub DeleteListedFiles() Dim i As Long Dim FName As String With Worksheets("SheetName") For i = 1 To 600 FName = .Cells(i, 1).Value If FileExists(FName) Then Kill FName End If Next i End With End...

Part and Inventory Search

Back
Top