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 Mike Lewis 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: *

  • Users: pvw
  • Order by date
  1. pvw

    using Open and Get to read data from file

    Hi Douglas With pure VBScript you can't perform file I/O. But you can use the FileSystemObject in VBScript to do this. Here is a good documentation with samples: FileSystemObject - Working with Files http://msdn.microsoft.com/library/en-us/script56/html/sgworkingwithfiles.asp Other related...
  2. pvw

    Why does Excel File Size explodes when using VBA?!

    Hi Ekelund1 There is no way to force Excel to convert the formulas. The conversion runs only when you open a book in Excel 5.0 or later, which was saved in Excel 5.0 or later workbook format. The 'shared formulas' method is a feature which was introduced in Excel 5.0 and is an internal function...
  3. pvw

    Why does Excel File Size explodes when using VBA?!

    Hi Ekelund1 Your sample macro writes 10'000 formulas into cells. A formula is saved as part of each cell. This means that each cell has its own formula information, when you save the book. Because the formulas are all similar to each other (they are repeated), Excel can handle them as shared...
  4. pvw

    Loading a two column combo box

    Hi Here's an example for a combobox with 2 columns and 4 list items (rows): Dim astrItems(3, 1) As String '(rows/columns) astrItems(0, 0) = "R1C1" astrItems(0, 1) = "R1C2" astrItems(1, 0) = "R2C1" astrItems(1, 1) = "R2C2" astrItems(2, 0) =...
  5. pvw

    Help with copyfromrecordset please

    Hi Neil You can still use UBound. The number of records is stored in the second dimension, so you have to write UBound(output_data_array, 2) When you've got 256 records, 'UBound(output_data_array, 2)' returns 255 because the array is zero-based (by default). Add the statement Option Base 1...
  6. pvw

    Help with copyfromrecordset please

    Hi Neil CopyFromRecordset is a method of the range object. It's not made for reading records into an array. But you can use 'GetRows' instead: Dim output_data_array As Variant output_data_array = sqlRs.GetRows(sqlRs.RecordCount) With this, you'll get a two dimensional array. HTH Philipp
  7. pvw

    Convert DialogSheets into a forms

    Hi sabascal There is a tool called 'Dialog Converter' from Baarns.com. You can download the original version for Excel 97 from my site: http://195.186.84.74/download/tools/DlgConv.exe The file DlgConv.exe includes the converter tool (xla Add-In) and a ReadMe.doc with hints and known issues...
  8. pvw

    Printscreen from VB AND print from clipboard

    Hi These two MS Knowledge Base articels describe the solution: HOWTO: Copy the Screen or Active Window to the Clipboard from Visual Basic http://support.microsoft.com/default.aspx?scid=kb;en-us;240653 HOWTO: Capture and Print the Screen, a Form, or Any Window...
  9. pvw

    Can't Call Procedure "Invalide Qualifier"

    Hi grrr223 I just checked the Excel VBA help. The remark about named arguments is correct but incomplete. My last example works because I used the argument name of the run method instead of the argument name of the CreateToolbar sub. Assuming CreateToolbar has 10 optional arguments and the 10th...
  10. pvw

    Convert a Remote Computer Name into a IP Address

    Hi There is a function LookupIPAdress. I think that this code can help you: www.scottandmichelle.net/scott/code/index2.mv?codenum=081 HTH Philipp
  11. pvw

    shell explorer.exe

    Hi Just pass the path as parameter: Shell "explorer " & ActiveWorkbook.Path The code above shows the explorer with the folder view. If you want to see the 'real' explorer view (with the tree), use the '/e' parameter: Shell "explorer /e, " & ActiveWorkbook.Path HTH Philipp
  12. pvw

    Can't Call Procedure "Invalide Qualifier"

    Hi grrr223 Instead of Call MODNAME.CreateToolbar(TOOLBAR) use Application.Run MODNAME & ".CreateToolbar", TOOLBAR In your code both arguments of CreateToolbar are optional. You can call the sub without these arguments: Application.Run MODNAME & ".CreateToolbar" If...
  13. pvw

    copy & Paste

    Hi max1565 The syntax seems to be ok. The only problem I can see is the declaration of 'LastRow' as data type Integer. If the last row is > 32'767 you'll get an overflow error. Variables for rows are usually declared as Long. Philipp
  14. pvw

    Adding numbers with the same background color

    Hi gsgriffin I hope you're using Excel. I wrote a little function which does your task: Public Function SumBGColor(CellRange As Range) As String Dim rngCell As Range Dim dblSumRed As Double Dim dblSumYellow As Double Dim dblSumGreen As Double Dim dblSumOther As Double For Each...
  15. pvw

    Save As Difficulty: Runtime Error 1004

    Hi Kevin I just want to inform you, that the line Application.DisplayAlerts = True at the end of the code won't be executed, because the "ThisWorkbook.Close" closes the book, in which the running code is. Closing the book stops code execution. Philipp
  16. pvw

    The Object that would not close!

    Hi PervinPJ In my opinion the code to release the objects is in the wrong order. In your code PowerPoint quits (PowerPoint.Quit) while there is still a object reference to the Presentation. The reference is cleared to late (Set ActivePresentation = Nothing). Because of this, PPT does not really...
  17. pvw

    Reading Stored Variables in a Text File from Multiple Computers

    Hi It's no problem to access a text file at the same time. If you open the file for "input", "output" or "append" without the keywords "lock read", "lock write" or "lock read write", the simultaneous access is possible. Because every...
  18. pvw

    Test if MS Word is open - how?

    Hi MrPeds Here's the code to your question: Function IsWordOpen() As Boolean On Error Resume Next Dim appWord As Object Set appWord = GetObject(, &quot;Word.Application&quot;) If Err.Number = 429 Then IsWordOpen = False ElseIf Err.Number <> 0 Then IsWordOpen = False...
  19. pvw

    Run-time error

    Hi izzyq I can't see a line highlighted in red :-(. Which line gives the error? Does the code fail in XL97 or XL2000/XL2002? Hope this can help you: - You're using &quot;Excel.Application.Version&quot; to check the version. I prefer the check with &quot;Application.VBE.Version&quot;. - Maybee...
  20. pvw

    Return LETTER of ActiveCell Column

    Hello JDTTEK Using &quot;Cells()&quot; is the best way to select the last used cell. If you're in a situation where you really need the column letter (f.e. to show it to the user), you can use the following function: Function GetColumnName(intColumn As Integer) As String If intColumn <= 0...

Part and Inventory Search

Back
Top