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 SkipVought 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. FaneDuru

    Simulate mouse over a window in another application

    Thanks Strongm! Nice piece of code. But I usually use SendMessage API to maipulate mouse cursor, click etc. I thought that mouse-move is able to 'move' the cursor not to bring it in a specific position. On my taste, SetCursorPos is a little easyer to use... I found the problem in my 'mouse_move'...
  2. FaneDuru

    Simulate mouse over a window in another application

    Solved... I looped 10 times through the sequence of SetCursorPos. I tried that before posting but now I added DoEvents. Dim i As Long For i = 1 To 10 SetCursorPos ContextMenuInfo(2) - (30 + i), ContextMenuInfo(4) + 15 DoEvents Next ContextMenuInfo(2) keeps window...
  3. FaneDuru

    Simulate mouse over a window in another application

    I need to simulate the mouse over a window of another application. I mean to trigger Mouse Move event... When I manually move the mouse over that specific window another window appears. I can determine the handle of that specific window, I know its X and Y, Top and Bottom positions and I can set...
  4. FaneDuru

    Excel 2007 VBA Ribbon problem

    Of course it is a mistake here: Sub RefreshRibbon() Set rIBONUL = GetRibbon(ThisWorkbook.Sheets("Memorie").Range("B1").Value) End Sub It should be: Sub RefreshRibbon() Set rIBB = GetRibbon(ThisWorkbook.Sheets("Memorie").Range("B1").Value) End Sub
  5. FaneDuru

    Excel 2007 VBA Ribbon problem

    Solved the problem (based on Rory Archibald via Ron de Bruin sample): Initializing code becomes: Public rIBB As IRibbonUI Sub Initializare(Ribbon As IRibbonUI) Set rIBB = Ribbon ThisWorkbook.Sheets("Memorie").Range("B1").Value = ObjPtr(Ribbon) End Sub The pointer to the Ribbon Object is...
  6. FaneDuru

    Excel 2007 VBA Ribbon problem

    Another thing: When it works well the code: Debug.Print rIBB Is Nothing returns False. When it does not work well it returns True meaning that riBB became Nothing... It looks that my way of calling 'Initializare' is unappropriate. Can anybody help on this issue?
  7. FaneDuru

    Excel 2007 VBA Ribbon problem

    I use an Excel 2007 addin (xlam) and in order to change some control labels, tips, images its XML code contains an 'onLoad' procedure named "Initializare": Public rIBB As IRibbonUI Sub Initializare(Ribbon As IRibbonUI) Set rIBB = Ribbon End Sub Most of time it works well except some...
  8. FaneDuru

    Any resources for VBScript with Excel?

    Basically you can open Excel from VBScript and do whatever there using this piece of code: Set Ex = CreateObject("Excel.Application") With Ex .Visible = False 'true .Workbooks.Open ("D:\MyPath\MyWorkbook.xls") a = .Workbooks("MyWorkbook.xls").Sheets(1).Cells(1,1).Value...
  9. FaneDuru

    Passing an argument to an Excel procedure

    I solve it but in a strange manner... This line does not work (x defined like "q"): With ExcelDeschis .Run "'MyWokbook to be called.xlsm'!myProc", x End With But this one works: With ExcelDeschis .Run "'MyWokbook to be called.xlsm'!myProc", "q" End With I used this...
  10. FaneDuru

    How to determine when a removable drive has been added

    I figured it out but in a little stange manner... This line of code: " .Run " & Chr(34) & "'" & Z & "'!myProc""" & ", Drive" & vbCrLf & _ has been replatec with this one: " .Run " & Chr(34) & "'" & Z & "'!myProc""," & " chr(34) & Drive & chr(34)" & vbCrLf & _ What is strange: It does...
  11. FaneDuru

    Passing an argument to an Excel procedure

    The next script finds the open session of Excel and call procedure 'MyProc'. It works without passing an argument. I mean the procedure is called if I do not add ', x'. When I tray to pass the argument it looks that it is a sintax probmem in the code... x = "q" Set ExcelDeschis =...
  12. FaneDuru

    How to determine when a removable drive has been added

    I almost solved the problem in this way: Sub test_Check_Drive_Insertion() Dim x As String, Z As String Z = ThisWorkbook.Name x = "Set objWMIService = GetObject(""winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2"")" & vbCrLf x = x & "Set colMonitoredEvents =...
  13. FaneDuru

    How to determine when a removable drive has been added

    It looks that the line: Set objLatestEvent = colMonitoredEvents.NextEvent makes Excel freeze if an event did not occur yet... I used Timer in a VBA module and until an event occurs I can play with Excel. In the moment of reaching the above line Excel 'waits' for an event to come Here is...
  14. FaneDuru

    How to determine when a removable drive has been added

    I have an Excel VBA application which sometimes needs to catch the event of removable drives adding (inserting in USB). I found in MSDN a monitoring WMI script sample able to trigger the adding or removing event: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ &...
  15. FaneDuru

    Browse for Drive starting from MyComputer

    Thanks Tony! It starts from My Computer indeed like the simpler code from VBScript forum posted above and like this one beside your string message it shows also 'Browse for Folder'. Even if I intend to browse for drive I think I have to let it showing whatever it wants... I hopped that...
  16. FaneDuru

    Browse for Drive starting from MyComputer

    Sorry Gavona, I missed your point… I was so focused on my idea that I did not read with enough attention what you suggested. It can be a solution, indeed. But, I refuse do believe that it is not possible to start browsing from My Computer using that FileDialog… Can anybody else find a...
  17. FaneDuru

    Browse for Drive starting from MyComputer

    I am afraid that I couldn't make me understood... I just need a way to start browsing from My Computer virtual folder...
  18. FaneDuru

    Browse for Drive starting from MyComputer

    In the meantime I found this piece of code in VBScript forum which starts browsing in My Computer (if sInitPath = 17) and I adapted a little: Function getDriveLetter(sCaption, sInitPath) Dim oShell As Object, oFolder As Object, oFolderItem As Object Dim return_ As String Set oShell =...
  19. FaneDuru

    Browse for Drive starting from MyComputer

    Thanks mintjulep! I am a little cleverer now but I still do not know how to solve the issue... Thanks Gabona, but I do not need a way to obtain the list of existing drives. I need to memorize a specific drive (checked to be external) selected by user. I can do that with the code posted...
  20. FaneDuru

    Browse for Drive starting from MyComputer

    I have an addin needing to set the drive where the back-up to be done. It should be an external media (HD or memory stick). I know how to identify/check if it is external media and I have the next function in order to Browse for a folder: Function GetDrive() As Variant Dim fldr As...

Part and Inventory Search

Back
Top