|
Mr.Kode wrote: what is the problem with that code?
I give up. What is the problem?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
Hi
I am trying to add Some code to ThisWorkbook in Excel file before opening it using C# but I can't.Can any body please tell me what to do?
the code looks like this:
Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
By the way I don't want to add this code in a standard module ,just in Thisworkbook.
thanks
[I am using VS 2008 and MS Office 2003]
my code looks like this but it adds to the Standard Module not ThisWorkBook:
Microsoft.Vbe.Interop.VBComponent oModule;
oModule = Excel_WorkBook.VBProject.VBComponents.Add(Microsoft.Vbe.Interop.vbext_ComponentType.vbext_ct_StdModule);
oModule.CodeModule.AddFromString("My Function Text");
|
|
|
|
|
Hi,
I'm storing data (not image) in my SQL database as a type varbinary.
Retrieving this table in a dataset.
With databinding i bind the datagrid to the dataset.
But the datagrid gives an error because it tries to convert byte[] to image (i guess.)
The columns are not persistent (predefined)
Anyone an idea how i can solve this ?
thx
kurt
|
|
|
|
|
Hi!
I am stuck in my approach.
I need to fetch files present in a folder with "day" and "year" (2, 2008) as parameter.
i need code for it. As of now i am able to fetch all the files present in the folder but am not able to fetch according to date. If anyone can help me, Thnx
|
|
|
|
|
Have a look at System.IO.File.GetCreationTime (or GetLastWriteTime), see if that will give you what you need.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I would like to fetch the filename(with complete path) from windows explorer right menu?
please guide me.
|
|
|
|
|
|
Hi,
Not sure where the best place for this question would be, but hopefully someone might be able to help.
I have developed a .Net 2.0 windows service that utilises the MS Office Excel 12.0 PIA. I am looking into the implementation of this service onto a number of production web servers and ideally would like to not have to install the full version of Office 2007 onto each server. It is possible to download the Office 2007 PIA redistributable package, but Office 2007 must be installed as a prerequisite.
Is there anyway I can utilise the Office Interop's on a server that does not have Office installed?
Thanx, and apologise if this is posted in the wrong forum...
Clean code is the key to happiness.
|
|
|
|
|
The Office Primary Interop Assemblies do nothing by themselves. They simply provide a way to call the Office programs to do something on your program's behalf.
Even if they're not visible, the Office apps have to run when you call the methods in the PIAs. If you check Task Manager, you will see that (in this case) EXCEL.EXE is running.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Had a feeling that was the case.
Thanx for the quick response...
Clean code is the key to happiness.
|
|
|
|
|
Hi!
I have an application that has a keyboard-listener (system-hook).
It is being notified on any keyboad-event, even if the app-windows is not active.
As far as that it works as designed.
My problem is, that it is possible, that someone pushed the space-bar or the cursor-buttons, what effects on the GUI, e.g. to buttons, list-views, etc... So if someone presses the curser-buttons a highlight wanders around my gui. And if the spacebar is hit and a button was highlighted this button will be pressed. This is what i´d like to avoid.
What i´d like to have is to make the gui ignore these keyboard inputs (except textboxes, where you need the keyboard).
Is there a way of making the GUI-elements not react on keyboard-actions?
Thanx
J.
|
|
|
|
|
Dear All,
We have two (ASP.net) web applications running on Windows Server 2003. First application runs on Framework 2.0 and the second one runs on Framework 3.5.
Most of the client machines are having Vista and we are facing a strange problem, i.e. IE7 restarts very frequently. There is no error logged or displayed and the pattern is also not consistant. IE gets restarted at any page and next time it works well at the same page.
This problem occurs on Vista + IE7 environment only.
Please guide.
|
|
|
|
|
sachinkalse,
I dont think anyone is going to be able to help you as you are being too vague.
What is your app doing when it crashes? Have you stepped through your code to see if you are causing exceptions? Are you trying to access something that the user account doesn't have privileges for?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Sorry for being vague.
It crrashes at any moment at any page before debug (stepped through).
As I have written in first message, there is no error at all. In all cases it just reboots IE.
More over all users have access permission.
|
|
|
|
|
Try running IE in No Add-Ons mode, which you can find at Start, All Programs, Accessories, System Tools, Internet Explorer (No Add-ons). If this then works, narrow down the add-on that causes the problem.
I would start by ensuring that Adobe Flash Player and Sun Java are up-to-date. The current Flash version[^] is 9.0.124.0 and Java is identified as "J2SE Runtime Environment 6 Update 6".
IE is highly extensible and many of the common extensions are pretty buggy. You might also want to check whether your anti-virus package is causing the problem - some try to second-guess Internet Explorer's security model but instead crash the browser.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi,
We have one GUI application and used with some user controls.
In this i need to write a pgm to "indicate this application when
a USB drive detect", So i written a sample appln with,
protected override void WndProc(ref Message m)
{
const int DBT_DEVICEARRIVAL = 0x8000;
base.WndProc(ref m);
switch (m.WParam.ToInt32())
{
case DBT_DEVICEARRIVAL:
MessageBox.Show("Found");
break;
}
}
And it is working fine, But i tried to write in my application, it is not working.
I dont have much idea about WndProc and windows messaging.
Is there any loop hole to skip the windows message ( ie 0x8000 ) coz of some where in the appln
to override again the WndProc(...) , Coz i have in this appln so many User controls used,
so couldnt able to look the source code.
If any one can help regarding this ,it will be very greatful help for me.
This is my orginal application which i add the code in the existing windproc() method. ( commened my code with Me Added ")
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
switch (m.WParam.ToInt32())
{
case WM_DEVICEARRIVAL://Me Added
MessageBox.Show("Found");//Me Added
break;//Me Added
}
switch( m.Msg )
{
case WM_PARENTNOTIFY:
if( m.WParam.ToInt32().Equals( WM_RBUTTONDOWN ) )
{
this.SelectedItems.Clear();
this.ContextMenu=null;
}
if (m.Msg == 20)
{
if (this.Items.Count == 0)
{
m_bRedraw = true;
Graphics g = this.CreateGraphics();
int w = 0;
w = this.Width;
w -= g.MeasureString(DISPLAY_MESSAGE, this.Font).ToSize().Width;
w = w/2;
g.DrawString(DISPLAY_MESSAGE, this.Font, SystemBrushes.ControlText, w, 30);
}
else
{
if (m_bRedraw)
{
this.Invalidate();
m_bRedraw = false;
}
}
}
if (m.Msg == 4127)
{
this.Invalidate();
}
}
|
|
|
|
|
How can I copy or move file from one directory to another.
|
|
|
|
|
|
Lets copy file in asynchronously
FileStream sourceFile = new FileStream(.....);
FileStream destinationFile = new FileStream(....);
byte[] buffer = new byte[BUFFER_LENGTH];
AsyncCallback readCallback = null;
readCallback = delegate(IAsyncResult readResult)
{
int byteRead = sourceFile.EndRead(readResult);
destination.BeginWrite(buffer,0,byteRead,new AsyncCallback(delegate(IAsyncResult writeResult)
{
desitnationFile.EndWrite(writeResult);
destinationFile.Flush();
sourceFile.BeginRead(buffer,0,buffer.Length,readCallback,null);
}),null);
};
sourceFile.BeginRead(buffer,0,buffer.Length,readCallback,null);
|
|
|
|
|
Sytem.IO.File.Copy("Try reading the books","or use Google, lazy")
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I know that C# doesn't directly implement it, though I found an article that describes a way to kludge around it, but I was just wondering whether anyone is still pursuing it. Back when I was doing Turbo Pascal semi-OOP programming it was the hot topic, but things have got a bit quiet since then. Does any language still support it?
Yeah, I know it's not directly relevant here, but I'm fiddling with a model for an electrical substation and looking at C# as an possible implementation language. Substations contain transformers, regulators, reclosers and breakers, and some transformers have the regulators built in, so it seemed a natural fit for MI. On closer inspection, it's not worth the trouble, but I'm still curious whether anyone is still trying to make it work.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
C# and Java don't, and it's unlikely they will in the future either. You can use interfaces instead.
Maybe VB.NET does support MI, I have no idea. Not sure if you want to go down that road....
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
The CLR does not support MI, so no language that runs directly in the CLR will be able to use MI.
(Well it is possible to generate interfaces and implement those at compiletime, but the actual code would not be true MI)
|
|
|
|
|
Thanks, Roger.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|