Actions pane are not available for programming in Excel 2003 using VSTO for VS 2008.
However, there is a workaround.
Create an office commandbar, Add a user control to it of type activeX.
Make your C# class com visible, create a new GUID and assign the attribute.
make your project COM Visible and also strong named.
The User control in .net containing windows forms controls will be available enabling you to create application level pane similar to actions pane.
The following piece of code is undocumented in MSDN but is a key thing.
objPane = (Office._CommandBarActiveX)actionsPane.Controls.Add(Microsoft.Office.Core.MsoControlType.msoControlActiveX, Missing.Value, Missing.Value, Missing.Value, true);
objPane.ControlCLSID = "";
objPane.Width = 900;
objPane.Height = 337;
objPane.Visible = true;
The key is set CLSID to the object GUID .
Wednesday, April 14, 2010
Actionspane or simple pane for Excel 2003
Labels:
c# Excel 2003 ActionsPane Add-in
Tuesday, March 9, 2010
SQL Server Management Studio 2005
If you are like me, who got used to modifying stored procedures by right-clicking and clicking modify and if you had tinkered around the scripting options, then you will find it confusing that suddenly sp_executesql seems to appear in the script and not the normal one.
Wonder why?
This will happen if you make IF NOT EXISTS option to be true.
This will cause management studio to display the script on modify or script new to be using sp_executesql syntax.
Turn IF NOT EXISTS option to false, and you will be fine.
Wonder why?
This will happen if you make IF NOT EXISTS option to be true.
This will cause management studio to display the script on modify or script new to be using sp_executesql syntax.
Turn IF NOT EXISTS option to false, and you will be fine.
Friday, February 12, 2010
Connect to Oracle from Visual Studio 2008 Server Explorer
If you want to connect to Oracle from Visual Studio 2008 Server Explorer, follow the below steps.
Install ODP.Net from Oracle (latest version)
While installing, make sure client bits are installed
After installation, add the following Enviroment variable
TNS_ADMIN pointing to the folder containing TNSNAMES.ORA
If there is no existing Oracle home, then copy TNSNAMES.ORA sample from Network/Admin/Samples folder and modify to your needs.
That's it.
Happy Programming....
Install ODP.Net from Oracle (latest version)
While installing, make sure client bits are installed
After installation, add the following Enviroment variable
TNS_ADMIN pointing to the folder containing TNSNAMES.ORA
If there is no existing Oracle home, then copy TNSNAMES.ORA sample from Network/Admin/Samples folder and modify to your needs.
That's it.
Happy Programming....
Thursday, January 7, 2010
Crystal Reports Version 10 with .Net 1.1 / Visual Studio 2003
Recently, I faced a strange problem.
One of my crystal reports had a sub report.
The sub report was displaying data partially though the entire data was made available to it.
This is a push method where Dataset gets formed and assigned as datasource to the crystal reports using SetDataSource method.
After hours of digging, I finally found out that, if you have sub reports, always set the datasource of the subreport and then set the datasource to the main report.
Hope it helps.
One of my crystal reports had a sub report.
The sub report was displaying data partially though the entire data was made available to it.
This is a push method where Dataset gets formed and assigned as datasource to the crystal reports using SetDataSource method.
After hours of digging, I finally found out that, if you have sub reports, always set the datasource of the subreport and then set the datasource to the main report.
Hope it helps.
Labels:
crystal reports c# .net
Thursday, July 2, 2009
Windows XP Explorer Right click menu does not popup or slow
I had this strange problem with right click on any file other than .cmd, .exe causing windows explorer to hang for like 45 seconds. After much searching on the web, came across this solution.
I used Reg Scan utility from Nirsoft, searched for registry values beginnning with \\ which denotes network path. Most the registry keys tied to these values where Shell, Open command for some registered file types and classes. When I pinged the IP address or network path, it was not going , so deleted all these entries. Bingo!!! Right click is now faster.
Also, the New menu under the right click context menu was taking some time. Some newly installed programs were causing this issue. If you don't recognize an entry in it, it is better to delete it. You can do this by using Nirsoft's Reg scan utility or shellexview from Nirsoft.
I used Reg Scan utility from Nirsoft, searched for registry values beginnning with \\ which denotes network path. Most the registry keys tied to these values where Shell, Open command for some registered file types and classes. When I pinged the IP address or network path, it was not going , so deleted all these entries. Bingo!!! Right click is now faster.
Also, the New menu under the right click context menu was taking some time. Some newly installed programs were causing this issue. If you don't recognize an entry in it, it is better to delete it. You can do this by using Nirsoft's Reg scan utility or shellexview from Nirsoft.
Thursday, June 4, 2009
Unspecfied Error OledbException
System.Data.OleDb.OleDbException: Unspecified error at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at System.Data.OleDb.OleDbConnection.Open() at
Cause:
You use Microsoft.JET OleDB Provider to open connection to Excel file or Access using windows forms or console application in .net/C# and you get this error.You most probably use a windows service account for running the application that uses above code.
Solution:
The Microsoft JET writes temporary files to the folder identified by TEMP user environment variable.For service accounts, due to server policies, this folder may be removed periodically.
The solution is to progammatically create this folder first if it doesn't exist so that this dreaded error doesn't come.
System.Environment.GetEnvironmentVariable("temp") will get you the variable identified by temp. Create this folder using this code piece.
if(!System.IO.Directory.Exists(System.Environment.GetEnvironmentVariable("temp")))
{
System.IO.Directory.CreateDirectory(System.Environment.GetEnvironmentVariable("temp"));
}
Hope this helps.
Cause:
You use Microsoft.JET OleDB Provider to open connection to Excel file or Access using windows forms or console application in .net/C# and you get this error.You most probably use a windows service account for running the application that uses above code.
Solution:
The Microsoft JET writes temporary files to the folder identified by TEMP user environment variable.For service accounts, due to server policies, this folder may be removed periodically.
The solution is to progammatically create this folder first if it doesn't exist so that this dreaded error doesn't come.
System.Environment.GetEnvironmentVariable("temp") will get you the variable identified by temp. Create this folder using this code piece.
if(!System.IO.Directory.Exists(System.Environment.GetEnvironmentVariable("temp")))
{
System.IO.Directory.CreateDirectory(System.Environment.GetEnvironmentVariable("temp"));
}
Hope this helps.
Wednesday, April 1, 2009
SVN - Unable to retrieve folder information from the server
If you have SVN installed, Web projects on VS.Net 2003 may not open correctly.
This is because SVN maintains source control information in a hidden folder called .svn.
This problem can be resolved.
Go to SVN settings and choose _svn instead of .svn directories.
Tortoise SVN may scare you saying you may lose working copies of existing projects.It will also require a system restart.There is a work around for not losing exising source control information.Here is what you should do.You can search for existing .svn directories using windows search and rename them manually to _svn. SVN will automatically reflect uncommited files by changing its image.
Once this is done, go to System Root\ Document and Settings \ User Name. Remove the folder called VSWebCache.This is a temporary folder which Visual studio creates for faster loading of web projects. Nothing will be lost on deleting this folder.
Now, if you open the web project, it will open correctly.
This is because SVN maintains source control information in a hidden folder called .svn.
This problem can be resolved.
Go to SVN settings and choose _svn instead of .svn directories.
Tortoise SVN may scare you saying you may lose working copies of existing projects.It will also require a system restart.There is a work around for not losing exising source control information.Here is what you should do.You can search for existing .svn directories using windows search and rename them manually to _svn. SVN will automatically reflect uncommited files by changing its image.
Once this is done, go to System Root\ Document and Settings \ User Name. Remove the folder called VSWebCache.This is a temporary folder which Visual studio creates for faster loading of web projects. Nothing will be lost on deleting this folder.
Now, if you open the web project, it will open correctly.
Subscribe to:
Comments (Atom)