15,905,785 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Keyur Raval 2022 (Top 16 by date)
Keyur Raval 2022
9-May-23 2:24am
View
Yes there is a reason behind that...but I can't explain all the details here. However you provided a good example of VBA. Thank you.!
Keyur Raval 2022
4-May-23 5:42am
View
I have intentionally used above line so that I can print error number and error description in notepad... Just I want to print error line number along with it.
Keyur Raval 2022
3-May-23 6:42am
View
I ran above code and it gives me error on Line 3
Line: 3
Char: 1
Error: Expected Statement
Code: 800A0400
Source: Microsoft VBScript Compile Error
Keyur Raval 2022
3-May-23 5:51am
View
I just want to print error line number in notepad.. can you please give me VBScript code for that?
Keyur Raval 2022
26-Nov-22 4:53am
View
Hello sir,
I tried the way you suggested... But it does not capture "Saving.." Or "Saved" message.. Also generally I do not closing the file manually... I just mentioned what happens when I close the file manually.
Keyur Raval 2022
25-Nov-22 0:06am
View
Hello Sir,
Thank you for your guidance for Reply comment. I will take care of that from next time..
Here my problems is that I am opening this Excel file is from web - and not saving to my local file system.
After that I run vbscript on this file. I use below code to get the particular instance of Excel Workbook:
Set obj = GetObject(,"Excel.Application")
obj.visible=True
obj.DisplayAlerts = True
Dim wb, pDestinationFile
For Each wb In obj.Workbooks
If InStr(wb.Name, DestFileName) > 0 Then
Set pDestinationFile = wb
End if
Next
.....My code to procee
'after that I am saving and closing the excel file as you mentioned in the code.
pDestinationFile.Save
pDestinationFile.Close
'' the Excel status bar is showing "Saving.. " message and when it completes the "Saving.." message starts on Excel Title Bar.. If I wait then after sometime it shows as "Saved".. but if I in between closing the excel then it shows "Uploading to Server" dialogue box. If I close this dialogue box then it shows a message box "changes saved locally will try to update your changes when you open excel next time"..
I want to wait until title bar "Saving... " turns to "Saved".. and want code for that...
Keyur Raval 2022
24-Nov-22 0:18am
View
Thank you for your comment.. sorry for being late. It is not throwing error and excel file is getting saved on local computer. However in title bar still it shows "Excel File Name. xlsx - Saving" when I close button it shows "Updating to server..."
I need a code that can see in the title bar until "Saving" turns to "Saved"
Currently I am using simple code to save workbook as mentioned below
ObjWorkbook.Save
Keyur Raval 2022
22-Jul-22 6:38am
View
How to do that?
Keyur Raval 2022
22-Jul-22 3:28am
View
It is not working ... I have mentioned this code in "What I have tried:" section.
Keyur Raval 2022
20-Jun-22 6:57am
View
yes.. got it.. thank you ... I will take care for the next time.
Keyur Raval 2022
20-Jun-22 1:00am
View
I am using Windows 10. I am also getting below error message:
MSB8036 The Windows SDK version 10.0.16299.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". UIXPathLib C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WindowsSDK.targets
Keyur Raval 2022
16-May-22 11:55am
View
This is working perfect!! Thank you so much!! Next time I would like to handle this kind of stuff by my own. If you have any reference youtube videos or any website can you please suggest.
Thank you so much....
Keyur Raval 2022
16-May-22 6:43am
View
Sorry for not mentioning details about the error. Here is the details about code which I run and then I have described the error which I am getting. Thank you!!
Code I run ==========================
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using RunDLLsDynamically;
using System.Text.Json;
using System.Collections;
namespace Run_DLL_Application
{
class Program
{
public static void Main(string[] args)
{
var opt = new JsonSerializerOptions() { WriteIndented = true };
string filePath = @"C:\Users\admin\source\repos\TestHarness\UtilityFunctions\bin\Debug\netstandard2.0\UtilityFunctions.dll";
Assembly asm = Assembly.ReflectionOnlyLoadFrom(filePath);
var result = asm.GetExportedTypes().GroupBy(t => t.Namespace, (ns, types) => new
{
@namespace = ns,
classes = types.Select(t => new
{
classname = t.Name,
methods = t.GetMethods().Select(m => new
{
methodname = m.Name,
@params = m.GetParameters().Select(p => new
{
seq = p.Position + 1,
paramname = p.Name,
paramtype = p.ParameterType,
}),
}),
}),
});
string strJson = JsonSerializer.Serialize(result, opt);
Console.WriteLine(strJson);
}
}
}
==================================================
Error:
Unhandled Exception: System.IO.FileLoadException: Cannot resolve dependency to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at Run_DLL_Application.Program.Main(String[] args) in C:\Users\admin\source\repos\Run_DLL_Application\Run_DLL_Application\Program.cs:line 23
Press any key to continue . . .
========================================
Even I tried with :
Assembly asm = Assembly.LoadFile(filePath);
for which I am getting below error:
Unhandled Exception: System.NotSupportedException: Serialization and deserialization of 'System.Type' instances are not supported. Path: $.classes.methods.params.paramtype. ---> System.NotSupportedException: Serialization and deserialization of 'System.Type' instances are not supported.
at System.Text.Json.Serialization.Converters.UnsupportedTypeConverter`1.Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
==============================================
Let me know if you require any more details from my end.
Thank you so much for your assistance.
Keyur Raval 2022
15-May-22 12:04pm
View
Thank you for your reply. I tried this but still i am getting error when i run your code. How can i integrate this code with my code? Can you please paste the whole code?
Keyur Raval 2022
28-Apr-22 2:15am
View
Thank you Griff!!
I was able to extract classes, methods and their parameters with the help of your answer.
Now again I want to use these classes, methods and their parameters in a C# program or visual basic program. My ultimate goal is to store class names and methods parameters in variable and run the dll. User can choose what method he want to execute.
Keyur Raval 2022
18-Apr-22 6:39am
View
Is there any code that we can write in Visual Studio and get the class names of particular dll file? I am very new to coding and need aasistance.
I got below code from web but I do not know how to add Assembly ref to the code.
//Read the dll.
Assembly assembly = Assembly.LoadFrom(@"E:\test.dll");
//Get the list of class name .
Type[] types = assembly.GetTypes();
List<string> classname = new List<string>();
foreach (Type t in types)
{
classname.Add(t.Name);
}
Show More