Answer Questions
MicahN File Protection from Users
Hello All, (I posted this in the Excel Forum yesterday and did not get any answers, hopefully someone here can help me) I would like to develop a VBA whereby users are only able to access the Excel file if they run the VBA code. Is there any way of doing this. I can stop users (via code): Closing Userforms etc. Deleting/Adding rows and columns Disable the menu Another thing I thought was to protect the Workbook and only unprotect it via VBA code. If the user choses "Disable Macros" at the security prompt, then they will have full access to the data. Is there a way to stop this. Another thought was to process the file without id being open ie set a reference to it from another another Excel VBA module (This will proba ...Show All
CamPeck empty datagrid
I'm sure i'm overlooking something simple... Can anyone tell me why my datagrid has no rows The query is definitely bringing back data because I can MsgBox the rst!field1 SQL = "SELECT field1, field2 FROM table" With rst .CursorLocation = adUseClient .Open SQL, cn, adOpenStatic, adLockBatchOptimistic Set DataGrid1.DataSource = rst End With With DataGrid1 .Columns(0).Width = 300 .Columns(1).Width = 3000 End With Never mind. I was closing my connection immediately after and that was losing my data. ...Show All
Peter Smith in Redmond Range
Hello, I'm developing a macro to do some calculations on a worksheet, but I always get a problem when I pass a Range as an argument to my function. I need to pass the range as argument. For example: Sub Name() Dim A As Range Set A = Worksheets("Sheet1").Range("CD4") MyFunction(A) End Sub Function MyFunction (ValueDoRange As Range) etc... End Function Thanks Hi, You don't say exactly what error you get but these two things may get your further along. Name is a bad choice for a routine name. It will compile but when you try to run it gives. Compile error: Expected: expression The other problem is the use of brackets around the passing argument ...Show All
bryanedds Mac Pc compatibility with Excel VB
I have a program I wrote in Excel VB that I want to be able to run on a Mac. However when ever I open the workbook on a Mac many of the user forms come up blank, and most of the string functions are undefined. specifically mid() and chr() functions. When I start a new program from scratch on the Mac the mid() functions work just fine. Is it possible to resolve these issues or are these lower level functions not compatible between both systems. PC excel vertion = Microsoft Excell 2002 (10.2614.2625) Mac vertion = Office X for mac Anyone The error isn't in the string functions. The problem is with some other library or command which is not valid in Mac VBA. I' ...Show All
ZackL Special action required for one item in a listbox
Can anybody please help with the folowing request, To add an item "other" to the array (the easy bit) and when a user selects this item, an input box pops up and allows the use to type in text and then for it to get listed in the same cell location. Many thanks for any assistance. Option Explicit Private Sub CommandButton1_Click() Dim i As Integer Dim s As String 'ActiveDocument.ListBox1.Clear s = "" For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) = True Then s = s & Me.ListBox1.List(i) & ", " End If Next i ' If Len(s) > 0 Then s = Mid(s, 1, Len(s) - 2) ActiveDocument.Unprotect ActiveDocument.Tables(1).Cell(9, 2).Range.InsertAfter (s) ActiveDocument.Protect ( ...Show All
Qiming Lu Outlook 2003 Scripting - Working with encripted messages
Hello! I have written a script with Outlook 2003 (English+SP2+Patches): Set oFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders("Test") Set oItem = oFolder.Items(1) Set oInspector = Application.Inspectors.Add(oItem) oInspector.Display It is simple! If the folder called Test contains "normal" messages, the script displays the first message in the inspector. But if it contains digitally encrypted messages the script fails at the 3. line. The error message is: The operation failed. Anybody met with this problem What is the solution Thank You! Tamas Pusztai ...Show All
Douglas Stockwell Need help with a macro (not sure if correct site... thx)
Hi! I'm using MS Word 2003 and am trying to create a macro to edit a very long file I have. The macro would make it so easy to fix, but I can't figure out how to create it correctly. I've been using the macro recorder so it records my moves. I had copied a word using ctrl+shift+left arrow and then tried to find the word again using the "find" function and then pasting what I had copied into the find function. When I open the macro, it is looking at the find function with the "text" of my previously copied information, i.e., "ARNP" rather than the new copied/pasted info from my next selection. (Does this make sense ) I'll paste the macro below for those who may be able to help. (All I want is to be able to fin ...Show All
wiscon a big thank you!
Hi All, I just wanted to express my thanks to Derek and all of you who have stepped in to help your fellow coders! It takes some time on my end to escalate these questions and I'm so glad that many of you are getting answers to your questions more quickly with the help of other community members. - brenda (ISV Buddy Team) Derek, have you considered becoming a Microsoft MVP If so, I would be a happy to recommend you for the program. -brenda (ISV Buddy Team) Hiya Brenda, I have thought about it yes. Last time I read about the MVP program it mentioned that it was based on the number of posts you make. After seeing some people on the forum making 1,000 of posts I didn't think I'd have the time to manage it. I h ...Show All
Doug DeBug MS Office document and image writer print driver
Besides removing this feature from Office during setup, is there a process to remove this virtual printer from 300 users with roaming profiles on an active directory network We are having an issue with this printer assuming the "default printer" selection for our users. As a work around we have changed their default printer, but after they reboot or log off / on it has defaulted back to the MS Ofc doc and image writer printer. I dont have the port, nor the driver on my XP installation. How do I install thanks Borge 1. Go to Control panel – Printer and fax 2. Add Printer – select local printer attached then manual 3. In the port option select Document image p ...Show All
Takezo Making process modal
Hi all I need saving from myself! I have a subroutine in Access which opens four Excel sheets and does extensive updating. The process takes 4 to 5 minutes. Before the process starts in earnest I check to see if Excel is open; if it is I stop the process and request that the user shuts Excel down. The problem with having Excel open is that the macro can end up picking a workbook which is open and not part of the routine, or the user continues to work on their open sheet, which effects commands such as ActiveSheet etc.. However, while the macro runs I often check my mail, which normally has Excel workbooks attached. Without fail I end up openning the workbook and crashing the subroutine. Is there a way to lock excel while I process, o ...Show All
Anthony Bellissimo Hiding the Database Window
Hello. I have been developing a reporting system in Access, and want to hide the database window before distributing the file to the users. I've tried using the settings on the Startup dialog box, and I've also tried setting the "StartupShowDBWindow" property programmatically via VBA, but nothing happens. I don't get any error messages, but the database window stays visible. Any suggestions Thanks Make sure you make a back up, you don't want to lock yourself out. Try this: DoCmd.SelectObject acForm, , True DoCmd.RunCommand acCmdWindowHide Put this code somewhere in the start up, or in the initial startup form. This code will actually hide the database window at anytim ...Show All
Magdalena_Heidi Writing result in Excel
Hello, I have the folowing code: Public Function DgrMinSec2DecDgr(Angle As Double) As Double ' * -------------------------------------------------------- ' * Program not yet working ' * -------------------------------------------------------- ' * Variables Dim grd As Integer Dim min As Integer Dim sec As Integer Dim calc As Double ' * Values grd = Angle \ 1 calc = (Angle - grd) * 100 min = calc \ 1 calc = (calc - min) * 100 sec = calc \ 1 DgrMinSec2DecDgr = grd + (min / 60) + (sec / 3600) DgrMinSec2DecDgr = Round(DgrMinSec2DecDgr, 4) ' should I round this result ' * Write - problem in writing in cell 'Debug.Print Round(DgrMinSec2DecDgr, 4) 'ActiveCell.Formula = "Write" & DgrMinSec2DecDgr ActiveCell.Sel ...Show All
LenaS iexplore.exe - Application Error
I get the following error message when I close my internet explorer. The instruction at "0x62304320" referenced memory at "0x62304320", The memory could not be "read". Click on OK to terminate that program. Any ideas what is causing this I discovered the problem. It was because of Yahoo Toolbar add on. I uninstalled it and now it works fine. Marty I don't use the Yahoo tool bar and I get a similar message when I close Ie 6.. "The instruction at "0x02653812" referenced memory at "0x0277bb2c". The memory could not be read. (All XP updates installed.) Not sure if this is related, but I ...Show All
Rainbow2007 Once copied, can we export as a GIF file?
How to convert MS Excel to jpg or gif and paste/insert to MS Word thank you very much I want copy excel selected range convert to jpg, gif and paste to MS outlook mail. Thank you I had no idea we could copy a range and paste as a graphic... I do the chart gif thing all the time for userforms (load the .GIF in to an image frame or the background of multipage, etc.). Copying a range as graphic and saving is as GIF and then using the image would reduce so, so much code writing. I see many great uses for this!!! So --- once we copy the range, can we: 1) export as a graphic file and save to the hard drive (like we can with GIF export for the ch ...Show All
S Tonstad Loop causing MS Word freeze
I tried to run a simple loop I created as a macro employing a user form that contains a label and a command button. I want the label caption to alternate between OFF and ON as the command button is clicked. There must have been an error of some sort as when I ran the macro it froze MS Word completely. No compile error ever appeared and the macro DID begin to run without protest. I looked at the task manager and everything under MS Word was "not responding". I ended the macro under the task manager and MS Word completely shut down! Here is the code. I realize it is not structured correctly, but should trying to run it cause MS Word to to freeze up and require a shut down via the task manager Surely it can't have creat ...Show All
