Search Results

Search found 251 results on 11 pages for 'msgbox'.

Page 7/11 | < Previous Page | 3 4 5 6 7 8 9 10 11  | Next Page >

  • vb.net Is there a simple way to add a sound to a button click

    - by user867621
    Is there a simple way of doing this I found this online and I am getting an error Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" _ (ByVal filename As String, ByVal snd_async As Long) As Long Function PlaySound(ByVal sWavFile As String) ' Purpose: Plays a sound. ' Argument: the full path and file name. If apisndPlaySound(sWavFile, 1) = 0 Then MsgBox("The Sound Did Not Play!") End If End Function A call to PInvoke function 'WindowsApplication3!WindowsApplication3.Module1::apisndPlaySound' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

    Read the article

  • SystemInformation.PowerStatus.BatteryLifeRemaining returns -1?

    - by dsrdakota
    In my code I have: Dim ps as PowerStatus = SystemInformation.PowerStatus Dim batteryTimeLeft as Integer = ps.BatteryLifeRemaining 'I have a problem here MsgBox("Time left on battery: " & cstr(batteryTimeLeft),vbInformation,"Info") PowerStatus.BatteryLifeRemaining always returns -1 when I have a battery present and used or when not used. Why does this always return -1? I currently am using MS .NET 4.0 Client Profile on VB.NET 2010 Express. I unplug the for my laptop and see if it makes a difference and it doesn't. Also tried in plugged in. Help please???

    Read the article

  • catching an event in VBScript

    - by be here now
    Hi, guys. This is a VBS script that opens google, fills a form, and clicks a search button. set ie = CreateObject("InternetExplorer.Application") ie.navigate("www.google.com") ie.visible = true while ie.readystate <> 4 wscript.sleep 100 WEnd set fields = ie.document.getelementsbyname("q") set buttons = ie.document.getelementsbyname("btnG") fields(0).value = "some query" buttons(0).click ie.quit Sub OnClickSub() MsgBox "button clicked!", 0 End Sub Obviously, buttons(0).click fires an onclick event of the button, which I somehow need to catch in my script, and provide it with some processing like launching OnClickSub(). Has anyone got any ideas how this should be done?

    Read the article

  • vb.net : is it possible to connect to sql server 2008 via odbc but not through vb.net code?

    - by phill
    I'm supporting an old vb.net program whose database it connected to was moved from SQL Server 2005 to SQL Server 2008. Is there a setting on SQL Server 2008 which will allow ODBC connections to access the database but not allow VB.NET to connect to it programmatically? the error i keep receiving in the app is: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) however I can connect to it when I create a system dsn to the sql server instance and through VS2005's Tools Connect to Database. Here is the code I'm using to connect: dim strC as string strC = "data source=bob; database=subscribers; user id=bobuser; password=passme" dim connection as New SqlClient.SqlConnection(strC) try connection.open() catch ex as Exception msgbox(ex.message) end try connection.Close()

    Read the article

  • Using an IN clause in Vb.net to save something to the database using SQL

    - by Rob
    I have a textbox and a button on a form. I wish to run a query (in Vb.Net) that will produce a query with the IN Values. Below is an example of my code myConnection = New SqlConnection("Data Source=sqldb\;Initial Catalog=Rec;Integrated Security=True") myConnection.Open() myCommand = New SqlCommand("UPDATE dbo.Recordings SET Status = 0 where RecID in ('" & txtRecID.Text & "') ", myConnection) ra = myCommand.ExecuteNonQuery() myConnection.Close() MsgBox("Done!", _ MsgBoxStyle.Information, "Done") When I enter a single value it works but when I enter values with commas it throws an error: "Conversion failed when converting the varchar value '1234,4567' to data type int." Could someone please help me to solve this or if there is an alternative way? Many Thanks

    Read the article

  • Visual Studio 2010 Macro - Reporting Progress

    - by user295841
    I have just discovered macros in Visual Studio and I can't be happier. Well... I have my complaints but... you know ;) A few of my macros are taking quite a while to complete and I am looking for a way to track progress. I build a log file during most of my macro processes but I have not found a good way to report progress without pausing the process. Ex. MsgBox("Progress") Any way to access the output window or even better the VS status bar?

    Read the article

  • Using True and False to select items to print

    - by user1753915
    I have a workbook that contains rows of information that needs to printed to a seperate worksheet in excel. I am trying to utilize a checkbox to indicate which items need to print and which items need to be skipped. The checkbox is located in column "A" and once checked and the macro ran, I want it to pick up the data in each cell of that particular row, transfer it a seperate worksheet (form), prompt and save the worksheet to pdf, clear the form, and then return to the main worksheet to continue until all rows have been checked. However, right now, my code is only looping through the very first "TRUE" statement and not continuing to the rest. Here is the code: Private Sub CommandButton1_Click() On Error GoTo ErrHandler: Dim i As Integer For i = 1 To 10 If ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = False Then Else If ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = True Then Call PrintWO Else End If Do Until ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = 10 MsgBox "Nothing Selected to Print" Exit Do Exit Sub Loop End If Next i ErrHandler: End Sub

    Read the article

  • Inserting new argument to table through search form of another table

    - by owca
    In my database I have a form for searching products (fields : id, name, manufacturer_id[set to display manufacturer's name], category_id, price). I would like to have the ability of adding manufacturers through this form. So I've created vba script but it does not work. Still when I enter new name it gives me prompt to "Select element from the list". What am I doing wrong ? Private Sub manufacturer_id_NotInTheList(NewData As String, Response As Integer) Dim strSQL As String, strInfo As String strInfo = "Manufacturer " & NewData & " is not on the list." & vbCrLf & "Add?" If MsgBox(strInfo, vbYesNo + vbQuestion, "Element not on the list") = vbYes Then strSQL = "INSERT INTO manufacturer (name, country, id_distributor) VALUES ('" & NewData & "','Undefined', '0');" DoCmd.SetWarnings (False) DoCmd.RunSQL strSQL Response = acDataErrAdded Else Response = acDataErrContinue NewData = "" Me.manufacturer_id.Text = "" End If End Sub

    Read the article

  • How to select the range for pasting using vba

    - by user1616384
    I wrote some code for selecting the particular row and pasting it in column wise using paste-special property. It is working correctly my code is : lngRow = Me.TextBox4.Value strCol = Me.TextBox5.Value Set rng = Range("A:A").Find(What:=lngRow, LookIn:=xlValues, LookAt:=xlWhole) If rng Is Nothing Then MsgBox "Value not found in row 1", vbExclamation Else Range(rng, rng.End(xlToRight)).Copy Range("A1:E3").Columns(strCol).Offset(, 1).PasteSpecial Transpose:=True Range("A1:E3").Rows(1).Copy Range("A1:E3").Columns(strCol).PasteSpecial Transpose:=True endif the problem here is I am using Range(rng, rng.End(xlToRight)).Copy to copy the values and for pasting I am using Range("A1:E3").Columns(strCol).Offset(, 1).PasteSpecial Transpose:=True. How can I paste all the values which are copied? Because if the values are in column F then this macro will not paste those values.

    Read the article

  • powerpoint macro timer

    - by mustafabattal
    Hi, I have to complete a timer on powerpoint, it countsdown for a specificed amount of time when a shape on particular slide is clicked. I heard macros could be a way to do this, but I have very little knowledge about them. With my research I was able to add a macro and pop out a message box when a shape is clicked*. How can I implement a timer with this? VB syntax is pretty unfamiliar to me. What happens after timer finishes is another question though. *with macro in module: sub hello_world() MsgBox( 'hello world!') end sub

    Read the article

  • php connection using HttpWebRequest and Get method

    - by Ahmet vardar
    Hi, i have a script returns some string, http://mysite.com/script.php php script; $data = $_GET['q']; $query = "SELECT * FROM `table` WHERE ID = '$data'"; $result = mysql_query($query); $num = mysql_num_rows($result); print $num; i want to connect this script with VB, using this code Dim con As String con = "http://mysite.com/script.php?q=" & My.Settings.setq Dim request = HttpWebRequest.Create(con) request.Method = "GET" Dim response = request.GetResponse() Using reader = New StreamReader(response.GetResponseStream()) msgbox(reader.ReadToEnd()) End Using it is not working. how can i do that ? thanks

    Read the article

  • Getting value of specific item in combobox in Visual Basic 2013

    - by JaceG
    I'm having great difficulty trying to find how to simply get the text of one specific item in a ComboBox. I have cmbSelectedHinge as a dropdownlist style. All I need is to know what the text is in position 0. I would have thought simply: MsgBox(cmbSelectHinge.Items.IndexOf(0)) but no. It returns "-1" even though there is a line of text in it. It seems this question has never before been asked on the internet, and there's no useful information on MSDN. Any help, please

    Read the article

  • Is there a way to access a php class method using javascript through jquery?

    - by Starx
    I have a js script, which is $("#feedbacksubmit").click(function() { if($("#frmfeedback").valid()) { var tname = $("#name").val(); var temail = $("#email").val(); var tphone = $("#phone").val(); var tcontent = $("#content").val(); var tsend = $(this).attr('ts'); $.post ( "bll/index.php", { action: 'mailfeedback', name: tname, email: temail, phone: tphone, content: tcontent, send: tsend }, function(data) { $('.msgbox').html(data); $("#frmfeedback")[0].reset(); }); return false; } }); however, I am trying to see if there is a way to access the class method of bll/index.php directly from the script, instead of posting parameters, to access it

    Read the article

  • update value of a variable outside a class in VB.NET

    - by dpp
    I have a class derived from a Form, it has textbox for username and password and an OK button. I want it to behave like an InputBox so I can use it like this: Dim Username As String = "" Dim Password As String = "" Dim authorization As New Authorization(Username, Password) authorization.ShowDialog() 'The user will click OK and I will expect the Username and Password to change based on the user input MsgBox(Username & " " & Password) The Authorization class: Public Class Authorization Dim RefUsername As String Dim RefPassword As String Public Sub New(ByRef Username As String, ByRef Password As String) InitializeComponent() RefUsername = Username 'I'm trying to pass reference instead of value RefPassword = Password 'I'm trying to pass reference instead of value End Sub Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AuthorizeButton.Click RefUsername = Username.Text 'I'm trying to change value of variable outside the class RefPassword = Password.Text 'I'm trying to change value of variable outside the class Me.Close() End Sub End Class In short, I want to change the value of variables outside the class when the user clicks the OK, how am I going to accomplish that?

    Read the article

  • networkstream always empty!

    - by ALEX
    hey I'm writing on an Server-Client program but when my client sends something, it never reaches my server! I'm sending like this: public void Send(string s) { char[] chars = s.ToCharArray(); byte[] bytes = chars.CharToByte(); nstream.Write(bytes, 0, bytes.Length); nstream.Flush(); } and Receiving in a background thread like this void CheckIncoming(object dd) { RecievedDelegate d = (RecievedDelegate)dd; try { while (true) { List<byte> bytelist = new List<byte>(); System.Threading.Thread.Sleep(1000); int ssss; ssss = nstream.ReadByte(); if (ssss > 1) { System.Diagnostics.Debugger.Break(); } if (bytelist.Count != 0) { d.Invoke(bytelist.ToArray()); } } } catch (Exception exp) { MSGBOX("ERROR:\n" + exp.Message); } } the ssss int is never 1 whats happening here???

    Read the article

  • How do I remove a control if not a specific type?

    - by joek1975
    I have a control that I need to restrict the types of child controls that it can contain during design time (dragging a new control onto an existing control on the form designer). I tried to do this by overriding the OnControlAdded event: Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs) MyBase.OnControlAdded(e) If e.Control.GetType() IsNot GetType(ExpandablePanel) Then MsgBox("You can only add the ExpandablePanel control to the TaskPane.", MsgBoxStyle.Exclamation Or MsgBoxStyle.OkOnly, "TaskPane") Controls.Remove(e.Control) End If End Sub This seems to work, however I get an error message from Visual Studio immediately after the control is removed: 'child' is not a child control of this parent. What does this mean? How can I accomplish this without errors occurring?

    Read the article

  • how to use same password on different userform on specicy worksheet?

    - by user3736237
    How to use same pw on different userform on specicy worksheet? E.g worksheet 1 open userform1 & worksheet 2 open userform2, but both using same password? This is the password ElseIf Pw = "1234" Then ImageNo = "PicGoh" pwno = 2 Or pwno = 3 ' ElseIf Pw = "1111" Then ' ImageNo = "PicGoh" ' pwno = 3 ElseIf Pw = "" Then pwno = 0 Else pwno = 1 End If End Sub Sub Mac3() If pwno = 0 Then Exit Sub ElseIf pwno = 3 Then UserForm2.Show ElseIf pwno = 2 Then UserForm1.Show ElseIf pwno = 1 Then MyVar = MsgBox("Wrong Password! Please Key In Your Password Again") If MyVar = 1 Then MacPw Mac3 End If End If End Sub

    Read the article

  • How to display values from another website to an new html page?

    - by user3098728
    How to display the value in a new html file from different website? This an example field of values that need to display into new html file and I want to display the said values in the input box (Contract ID) of this page JSFiddle. I have 2 JS code that would display that values, but unfortunately its not working and I dont know how to display that value in html input box. Please help me. Thank you I want to display the said value in this input box: Here the JS file to read the values: function scanLapVerification() { try { var page_title = "Title"; var el = getElement(document, "class", "view-operator-verification-title", ""); if (!el || el.length == 0) return; if (el[0].innerText != page_title) return; var page_title = ''; var el = getElement(document, "class", "workflowActivityDetailPanel", ""); if (el && el.length > 0) { var eltr = getElement(el[0], "tag", "tr", ""); if (eltr && eltr.length > 0) { //Read Contract ID var contractId = { CI: { id: null } }; var con_id = null; for (var i = 0; i < eltr.length; i++) { tr_text = eltr[i].innerText; if (tr_text.substr(0, "Contract ID".length) == "Contract ID") con_id = "CI"; if (con_id && tr_text.substr(0, "Contract ID".length) == "Contract ID") { contractId[con_id].id = tr_text.substr("Contract ID".length + 1, tr_text.length - "Contract ID".length - 1); } } var contract_id = contractId.CI.id; return { content: "cid_check", con_id: con_id }; } return { status: "KO" }; } catch (e) { alert("Exception: scanLapVerification\n" + e.Description); return { status: "KO", message: e }; } }; And here's the 2nd JS that display to a new html page: function scanLapVerification() { chrome.tabs.sendRequest(tabLapVerification, { method: "scanLapVerification" }, function (response) { msgbox("receiveResponse: scanLapVerification " + jsonToString(response, "JSON")); //maintaining state in the background if (response.data.content == "cid_check") { //Popup window features var popupWindow = null; var name; var width = 550; var height = 200; var left = parseInt((screen.availWidth / 2) - (width / 2)); var top = parseInt((screen.availHeight / 2) - (height / 2)); var windowFeatures = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top; //Input new address with popup window if (confirm("Does the client has new address?") == true) { popupWindow = window.open('/htmlname.htm', "title", windowFeatures + encodeURIComponent(response.data.contract_id)); popupWindow.focus(); } else { name = ""; } }); }

    Read the article

  • Get user profile size in vbscript

    - by Cameron
    Hello, I am trying to get the size of a user's local profile using VBScript. I know the directory of the profile (typically "C:\Users\blah"). The following code does not work for most profiles (Permission Denied error 800A0046): Dim folder Dim fso Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder("C:\Users\blah") MsgBox folder.Size ' Error occurs here Is there another way to do this? UPDATE: I did some deeper digging and it turns out that the Permission Denied error occurs if permission is denied to some subfolders or files of the directory whose size I wish to get. In the case of user profiles, there's always a few system files that even the Administrator group does not have permission to access. To get around this, I wrote a function that tries to get the folder size the normal way (above), then, if the error occurs, it recurses into the subdirectories of the folder, ignoring folder sizes that are permission denied (but not the rest of the folders). Dim fso Set fso = WScript.CreateObject("Scripting.FileSystemObject") Function getFolderSize(folderName) On Error Resume Next Dim folder Dim subfolder Dim size Dim hasSubfolders size = 0 hasSubfolders = False Set folder = fso.GetFolder(folderName) ' Try the non-recursive way first (potentially faster?) Err.Clear size = folder.Size If Err.Number <> 0 then ' Did not work; do recursive way: For Each subfolder in folder.SubFolders size = size + getFolderSize(subfolder.Path) hasSubfolders = True Next If not hasSubfolders then size = folder.Size End If End If getFolderSize = size Set folder = Nothing ' Just in case End Function

    Read the article

  • How do I Install fonts on Windows Web Server 2008 R2

    - by Eric Brearley
    I would like to install Arial on to our web servers. Just need to add, this is because we generate reports server-side and make them available in a number of downloadable formats (Excel, PDF etc), hence the need to have the fonts installed on the server. I have console access to our webfarm, and from the server I've copied the .ttf files and placed them in c:\fonts folder. Then I run the following VBScript on the server. ' VBScript to install fonts on Blade Servers ' Arial font-family Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace("c:\fonts") Set objFolderItem = objFolder.ParseName("arial.ttf") objFolderItem.InvokeVerb("Install") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace("c:\fonts") Set objFolderItem = objFolder.ParseName("arialbd.ttf") objFolderItem.InvokeVerb("Install") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace("c:\fonts") Set objFolderItem = objFolder.ParseName("arialbi.ttf") objFolderItem.InvokeVerb("Install") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace("c:\fonts") Set objFolderItem = objFolder.ParseName("ariali.ttf") objFolderItem.InvokeVerb("Install") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace("c:\fonts") Set objFolderItem = objFolder.ParseName("ariblk.ttf") objFolderItem.InvokeVerb("Install") msgbox "Fonts installed" I get the message box, but no font installation pop-ups like I do when I run this script on my desktop. The fonts do not get installed, they do not sure in the font selection dialogue in notepad (on the web server) and we get the asp.net exception "Font 'Arial' cannot be found.". Have also restarted the server. I have also tried copying the .ttf files to the c:\windows\fonts folder and restarting the server. What do I need to do to install fonts on Windows Web Server 2008 R2?

    Read the article

  • Win XP error 0x80041003 using GetObject/winmgmts

    - by John Lewis
    My computer is called "neil" and I want to set some values using WMI in vbScript. I adapetd the script below from one supplied by Microsoft. When I run it in my browser I get Error Type: (0x80041003) /dressage/30/pdf2.asp, line 8 I suspect it is some registry/security setting. Any advice? John Lewis FULL SCRIPT call Print_HTML_Page("http://neil/dressage/ascii.asp", "ascii") Sub SetPDFFile(strPDFFile) Const HKEY_LOCAL_MACHINE = &H80000002 strKeyPath = "SOFTWARE\Dane Prairie Systems\Win2PDF" strComputer = "." Set objReg=GetObject( _ "winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") strValueName = "PDFFileName" objReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,_ strKeyPath,strValueName,strPDFFile End Sub Sub Print_HTML_Page(strPathToPage, strPDFFile) SetPDFFile( strPDFFile ) Set objIE = CreateObject("InternetExplorer.Application") 'From http://www.tek-tips.com/viewthread.cfm?qid=1092473&page=5 On Error Resume Next strPrintStatus = objIE.QueryStatusWB(6) If Err.Number 0 Then MsgBox "Cannot find a printer. Operation aborted." objIE.Quit Set objIE = Nothing Exit Sub End If With objIE .visible=0 .left=200 .top=200 .height=400 .width=400 .menubar=0 .toolbar=1 .statusBar=0 .navigate strPathToPage End With 'Wait until IE has finished loading Do while objIE.busy WScript.Sleep 100 Loop On Error Goto 0 objIE.ExecWB 6,2 'Wait until IE has finished printing WScript.Sleep 2000 objIE.Quit Set objIE = Nothing End Sub

    Read the article

  • How can I cause Task Scheduler to "fail" if a dialog box returns a certain result?

    - by Roger
    I'm working on a VBScript to do a weekly reboot of all machines on our network. I want to run this script via Task Scheduler. The script runs at 3:00 AM, but there is a small chance that users may still be on the network at that time, and I need to give them the option to terminate the reboot. If they do so, I would like the reboot to occur the next night at 3:00 AM. I've set Task Scheduler up to repeat in this way. So far, so good. The problem is that if the user selects "Cancel" in my script, the Task Scheduler does not see my task as failed, and won't run it again the next night. Any ideas? Can I pass an errorcode to task scheduler or otherwise abort the task via VBScript? My code is below: Option Explicit Dim objShell, intShutdown Dim strShutdown, strAbort ' -r = restart, -t 600 = 10 minutes, -f = force programs to close strShutdown = "shutdown.exe -r -t 600 -f" set objShell = CreateObject("WScript.Shell") objShell.Run strShutdown, 0, false 'go to sleep so message box appears on top WScript.Sleep 100 ' Input Box to abort shutdown intShutdown = (MsgBox("Computer will restart in 10 minutes. Do you want to cancel computer restart?",vbYesNo+vbExclamation+vbApplicationModal,"Cancel Restart")) If intShutdown = vbYes Then ' Abort Shutdown strAbort = "shutdown.exe -a" set objShell = CreateObject("WScript.Shell") objShell.Run strAbort, 0, false End if Wscript.Quit Appreciate any thoughts.

    Read the article

  • Deleted printers keeps coming back - and multiply

    - by MojoDK
    My users are on 2012 R2 RDS Session Host servers. I've used "Deploy Printers" (from Print Manager) to deploy 4 printers. The last week, I've had a lot of problems where users can't print. If I deleted the printer and added it again, they could print just fine. Now I've removed all printer deploying from GPO - and I have no printers in any login scripts. I did a gpupdate /force, but all the 4 printers are now listed 3 times... If I delete the printers and log off and back on, all the printers are popping up again. Sigh! This is driving me nuts. This script doesn't show any of the "SVFREJA" printers... Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colPrinters = objWMIService.ExecQuery ("Select * From Win32_Printer") If colPrinters.Count <> 0 Then 'If there are some network printers Dim s s = "" For Each objPrinterInstalled In colPrinters ' For each network printer s = s + objPrinterInstalled.Name + chr(13) Next msgbox s End if It gives me this result... (sry for the big picture) My problem is not with the "redirected" printers, my problem is that I have several printers with the same name (on SVFREJA) and I can't get rid of them. Any idea why I can't get rid of the "ophaned" printers??

    Read the article

  • Prevent 'Run-time error '7' out of memory' error in Excel when using macro

    - by MasterJedi
    I keep getting this error whenever I run a macro in my excel file. Is there any way I can prevent this? My code is below. Debugging highlights the following line as the issue: ActiveSheet.Shapes.SelectAll My macro: Private Sub Save() Dim sh As Worksheet ActiveWorkbook.Sheets("Report").Copy 'Create new workbook with Sheets("Report"(2)) as only sheet. Set sh = ActiveWorkbook.Sheets(1) 'Set the new sheet to a variable. New workbook is now active workbook. sh.Name = sh.Range("B9") & "_" & Format(Date, "mmyyyy") 'Rename the new sheet to B9 value + date. With sh.UsedRange.Cells .Value = .Value 'eliminate all formulas .Validation.Delete 'remove all validation .FormatConditions.Delete 'remove all conditional formatting ActiveSheet.Buttons.Delete ActiveSheet.Shapes.SelectAll Selection.Delete lrow = Range("I" & Rows.Count).End(xlUp).Row 'select rows from bottom up to last containing data in column I Rows(lrow + 1 & ":" & Rows.Count).Delete 'delete rows with no data in column I Application.ScreenUpdating = False .Range("A410:XFD1048576").Delete Shift:=xlUp 'delete all cells outwith report range Application.ScreenUpdating = True Dim counter Dim nameCount nameCount = ActiveWorkbook.Names.Count counter = nameCount Do While counter > 0 ActiveWorkbook.Names(counter).Delete counter = counter - 1 Loop 'remove named ranges from workbook End With ActiveWorkbook.SaveAs "\\Marko\Report\" & sh.Name & ".xlsx" 'Save new workbook using same name as new sheet. ActiveWorkbook.Close False 'Close the new workbook. MsgBox ("Export complete. Choose the next ADP in cell B9 and click 'Calculate'.") 'Display message box to inform user that report has been saved. End Sub Not sure how to make this more efficient or to prevent this error.

    Read the article

  • Using GPO to collect data about VMware view activity

    - by MoSiAc
    Our security group wants us to begin logging data for external access to our view enviroment. At first we thought that view security would be logging all source ip's that are external in nature so if for some reason there is an intrusion we would have record of it there. Of course our firewall logs all that information but correlating it to view is sketchy at best with our current implementation. We know on viewdesktops there is a set of keys in VolitateEnviroment that contains stuff such as source ip and username, etc. We have a script in place that, when run as a logon script attached to a user account in AD collects the information as we need it. If we have a GPO run the same script the information does not get collected. We feel like there is a piece of the puzzle we're missing but we don't know what. If anyone knows what we're forgetting or misconfiguring that would be great, or if you have a better way of us collecting external source ip's for view specifically we'd be interested in that as well. Thanks, EDIT CODE Batch script to dump to text file @echo off timeout 20 echo %computername%/%username% %time% %date% c:\vdi\vmware.txt echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c:\vdi\vmware.txt reg query "HKEY_CURRENT_USER\Volatile Environment" /v "ViewClient_LoggedOn_Username"c:\vdi\vmware.txt reg query "HKEY_CURRENT_USER\Volatile Environment" /v "ViewClient_IP_Address"c:\vdi\vmware.txt echo.c:\vdi\vmware.txt VB Script to display values Const HKEY_CURRENT_USER = &H80000001 Set wmiLocator=CreateObject("WbemScripting.SWbemLocator") Set wmiNameSpace = wmiLocator.ConnectServer(".", "root\default") Set objRegistry = wmiNameSpace.Get("StdRegProv") sPath = "Volatile Environment" lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClien_Machine_Name", vMachine) lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClien_IP_Address", vIP) lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClien_MAC_Address", vMAC) msgbox "The Remote Device Name is " & vMachine & " @ " & vIP & " (" & vMAC & ") " he wanted me to mention that the batch file actually runs and I can see it counting down when I reconnect but it does not grab the registry values.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11  | Next Page >